I'm using CloudFormation to bring up a single instance in an autoscaling group (MaxSize: 1)
I would like to know how to access the internal IP of that instance so I can assign it a friendly name with Route 53 in the same template.
If it were just a AWS::EC2::Instance it would be easy but it is defined as an autoscaling group so I don't have access to the "PrivateIP" attribute
From CloudFormation, you can't.
Cloud Formation builds your auto scaling group, but it's scaling group itself that is responsible for creating that instance. In some cases, Cloud Formation will have finished creating the stack prior to the scaling group triggering and completing the creation of the instance.
In order to achieve what you want through CloudFormation, you should add an Elastic Load Balancer (ELB) to the front. Then register the ELB address with Route 53, and tie that into the scaling group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With