I'm very new to AWS and cloud services in general, I'm trying to set up a simple webserver + database stack, as a staging environment before going into production and scaling out. My question regards the discovery of the RDS endpoints from the EC2 instances, is there a way to make it so the instances have an environment variable containing the address to the RDS endpoint? something like Heroku, or is there a better way to do this? Do tools like Consul or CloudFormation help in this regard? I know that RDS endpoint don't change but the configuration would still be manual for example for every instance in autoscaling group right?
Asked
Active
Viewed 707 times
1 Answers
0
CloudFormation could help, because it has Outputs that inform you of the values on the resources created, there's also Hashicorp's Terraform which also have an "output" that you could use in your provisioning scripts.
There's also the aws-cli some config and some sed/awk could help your machines to discover AWS resources from a bash script. If you prefer more sophisticated languages than bash there's also several libraries like python-boto or ruby's fog which can achieve the same result.
Pick your poison.

theist
- 1,229
- 2
- 10
- 24
-
Thanks, I looked into `terraform` and it seems that it does provide a way to render templates from variables, which I can use to generate `user_data` scripts for instances. It seems clean enough. – devster Sep 30 '15 at 19:54