Sub topic 14
Sharing Networks and Resources Across Accounts
This chapter assumes you know how cross-account IAM roles work and have an organization with trusted access enabled. Separate accounts isolate workloads, but isolation should not mean duplicating every VPC, transit gateway and DNS rule. AWS Resource Access Manager (RAM) lets one account share resources with others, so you build them once and use them everywhere.
How RAM sharing works
A resource owner creates a resource share. The share has three parts: the resources, the principals that receive them, and a managed permission that limits what the principals can do. Principals can be individual accounts, OUs, or the whole organization.
To share with OUs or the organization without per-account invitations, run this once from the management account:
aws ram enable-sharing-with-aws-organizationAfter that, a share to an OU takes effect immediately for every account in it, including accounts added later. Sharing to an account outside the organization still requires an invitation.
Common shared resources
| Resource | Typical owner | What consumers get |
|---|---|---|
| VPC subnets | Network account | Launch EC2, RDS and other resources into shared subnets |
| Transit gateway | Network account | Attach their own VPCs to a central hub |
| Route 53 Resolver rules | Network account | Forward DNS queries to shared resolvers |
| License Manager configurations | Management or tools account | Consume shared license pools |
Shared VPC subnets
With VPC sharing, a network account owns the VPC and shares selected subnets with workload accounts. Participants create their own instances, but they cannot modify the VPC, route tables or the subnets themselves. Security groups belong to the account that creates them.
aws ram create-resource-share \
--name shared-app-subnets \
--resource-arns arn:aws:ec2:eu-west-1:444455556666:subnet/subnet-0abc1234example \
--principals arn:aws:organizations::999988887777:ou/o-exampleorgid/ou-examplerootid111-exampleouid111Here 444455556666 is the network account and 999988887777 is the management account that owns the organization.
Choosing between shared VPCs and transit gateway
Shared subnets suit teams that want one network with centrally controlled addressing and routing. A transit gateway suits teams that need their own VPCs, for example for stricter blast-radius isolation, and connects them through a hub. Many organizations use both: shared subnets inside an environment and a transit gateway between environments.
Common errors
- Availability Zone mismatch. Zone names such as
eu-west-1amap to different physical zones in different accounts. Compare AZ IDs such aseuw1-az1when you plan subnets. - Shared resource not visible. The consumer may be in a different Region from the resource, or the share may target an OU that does not contain the account.
- Cleanup blocked. You cannot unshare a subnet while participants still run resources in it.
Exercise
A workload account was moved into the Workloads OU after a subnet share was created for that OU. Does it need an invitation to use the subnet? Which AWS setting makes this work?
Show answer
No. Once sharing with AWS Organizations is enabled, a share to an OU applies to every account in it, including accounts added later, so no invitation is needed. The account still needs IAM permissions to launch resources in the subnet.