It is important to know the extent of your AS, to better identify the proper management. Meanwhile, you can do swimming. Generally, it is a great way to increase flexibility in your spine without jarring it. It also helps to increase flexibility in your neck, shoulders, and hips. You may find it easier to perform aerobic exercises while in the pool. Range-of-motion and stretching exercises can also help maintain flexibility in your joints and preserve good posture. Proper sleep and walking positions and abdominal and back exercises can help correct your kyphosis.
You can check this link to learn how to correct this posture arising from from your AS.