We currently have 4 aws accounts:
- root - consolidated billing, domain purchased via route 53
- development
- staging
- production
And they're all managed via terraform cloud as separate workspaces.
in dev/stage/prod I have a load balancer routing requests to ECS and various other resources.
I'd like to use the same domain to point to each environment with the following path:
- dev.mydomain.com => development load balancer
- stage.mydomain.com => staging load balancer
- mydomain.com => prodution load balancer
If they were all in 1 single AWS account/workspace, this would be easy peasy, take the output of that static IP and add it into the route 53 A record for each subdomain.
But, is it possible at all to achieve this across multiple aws accounts, or is there a better pattern to follow to achieve this?