We would like to create a template for a fairly standard stack in AWS. We need three layers.
Layer: Elastic Load Balancer
Layer: several web servers which are created / destroyed according to alarms triggered by the demand on the site
Layer: a database server
Instances on Layer 2 should know the host name of the database instance. Ideally I would like to get hold of the private IP of the database instance and pass it through user-data to the web servers.
Fn::GetAtt does not support the private ip (only the public)
I suppose an alternative would be to build the stack and afterwards to set manually the db private ip. It does though make our setup a bit less clean. We would ideally like everything to be described in the template. (even if this involves running a script through user-data)
Any suggestions?