I do have three AWS accounts:
- Shared (Where the aws-cdk pipelines live)
- Development
- Production
The Shared account owns a route53 domain name with the corresponding zone.
I do want to allow Development and Production to be able to use those domain names (attach dns records, say dev.domainname.com
)
Edit: I need to access other resources (s3 buckets, certificatemanager, ...) in the shared account as well, this was a simplification for the sake of the question.
I bootstrapped the accounts and cross account deployment of pipeline stages works as per this guide
If I try to deploy a stack which uses the domain it fails as expected since the role (cfn-exec-role
) in the Development stack has no permissions on the resources of the Shared Stack.
I could go and attach the necessary policies in the Shared Stack allowing the Roles in the Development and Production Stack access the the necesserary resource but is there any way to solve this in Code as per "Infrastructe as Code"?
This would require getting the execution roles of the Development and Production accounts and attaching permissions in the Shared Account