I am new to Cloud Formation. I need a little help. I have created 2 EC2 instances using .yaml file. One is my database instance and other is my web instance. Now I have to give the IP of my database instance in a configuration file of my web instance. How can it be done?
You can refer to the private IP address of an EC2 instance using !GetAtt db-instance.PrivateIp
(where db-instance
is the node name of that instance in your YAML template (at the top-level of the definition).