Since you are talking about cyberlimb attributes that start at rating 2 I am assuming SR6?
All characters start at attribute ratings 1. They can be increased with attribute points from attribute priority, in some cases via adjustment points from metatype priority (only attributes that have a maximum metatype attribute rating higher than 6) or via customization karma.
All basic cyberlimbs start at attribute rating 2, no matter what your natural attribute rating is and no matter what metatype you are. They can be increased with Attribute increase as high as you like, but you can at most benefit of an agility or strength rating in your cyberlimb that is equal to your natural attribute rating + 4.
In the rules it says all cyberlimbs start all attributes at 2. Does that mean that at the beginning of character creation my character has a 2 in the attribute the limb is designed to enhance or does that mean when I buy a cyberlimb I have to buy the agility up to the level I want.
Your natural attribute ratings and your cyberlimb attribute ratings are separate.
If you have a natural Strength of 5 and buy a cyberlimb then the basic cyberlimb will start with a Strength rating of 2, not 5. If you wish to increase it to 5 then you have to spend 3 capacity and 15,000 nuyen. If you instead wish to increase it to 9 then you instead spend 7 capacity and 35,000 nuyen. If you instead wish to increase it to 12 then you spend 10 capacity and 50,000 nuyen (but you will only benefit from Strength rating 9, 4 more than your natural Strength rating, since your natural Strength in this example is 5)
Scenario 1: Before character creation even begins I know I want an obvious cyberarm for agility with a +2 boost ultimately bringing my agility to 7. Do I start agility at 2 (the cyberarm attribute default) instead of 1 and then spend points on agility bringing it up to 5? If so the limb costs 25,000, 15,000 for the base and 10,000 for the boost achieving the desired 7 agility on the arm.
Scenario 2: I start all stats at 1 before character creation and bring my agility up to 5 and then buy the cyberarm. In this case I would have to pay 40,000 for the same arm. This would break down as 15,000 for the arm and an additional 25,000, five levels at 5000 a piece, to bring my agility for the arm up to the desired 7. This would be like cutting off my agility 5 arm, replacing it with an agility 2 cyber and boosting it to 7.
Your natural attribute ratings and your cyberlimb attribute ratings are separate. The rating of your cyberarm attributes is not affected by your natural attribute ratings or your metatype (except that you can only benefit from your natural attribute rating + 4). The cost of your cyberarm is not affected by your natural attribute rating or your metatype.
Your obvious cyberlimb always start at Agility 2, 15 capacity and it cost 15,000 nuyen. No matter what your natural agility rating or your metatype is. If you wish to increase the agility rating of the cyberlimb from 2 Agility to 7 Agility then you spend 5 out of your 15 capacity and 5,000 * 5 = 25,000 nuyen. Note that in order to benefit from a cyberarm with an Agility rating of 7 your natural rating need to be 3 (or more).