I have a transit gateway in my AWS account and I want to share it with another account or within my organization.
Resolution
Prerequisites: Make sure that you're in the same AWS Region as your transit gateway. Set up AWS Resource Access Manager (AWS RAM) in the Region where you want to share resources.
Share your transit gateway
Complete the following steps:
- Open the AWS RAM console.
- To share with an account in your organization, turn on resource sharing.
- Choose Create a resource share, and then enter a name.
- For Select resource type, choose Transit gateways.
- Select your transit gateway.
- (Optional) Under Tags, add tags for the resource share.
Note: The tags don't apply to the transit gateway.
- Choose Next.
- Choose Transit gateway resource share, and then choose either Allow sharing with anyone or Allow sharing only within your organization.
- Select Principals, and then enter the account ID or organization ID.
- To add principles, choose Add. Then, choose Next.
- Choose Create resource share.
Accept the transit gateway connection
If you're sharing within an AWS Organization, then the AWS service automatically accepts the resource share. If you share your transit gateway outside of your organization, then from the recipient's account, accept the resource share, and create a transit gateway attachment.
If you turned on Auto accept shared attachments when you created your transit gateway, then your cross-account attachments are automatically accepted in the owner account. If you didn't turn on Auto accept shared attachments, then from the owner account, accept the shared attachment and configure the transit gateway route table.
Add route to VPC route table
From the recipient's account, add a route to the VPC route table that points to the transit gateway.
Note: If an account with an attachment leaves the organization, then the attachment remains functional. Either the account that has the transit gateway or the account that has the attachment can delete the transit gateway attachment.