Reputation: 101
I have different EC2 instances trying to access RDS instance. I want to upfront set RDS instance 'canonical name' within configuration file so that after deployment I don't need to make any changes to configuration files.
I have following questions:
Is there anyway, one can assign canonical name to a RDS instance within cloudformation template?
If above is not possible, can I setup dependency chain between EC2 creation and RDS instance (i.e. create RDS instance first, query it's name/ip and than create EC2 instance)
Thx
Upvotes: 0
Views: 1291
Reputation: 20749
The canonical name of an RDS instance will always be generated automatically by AWS, however the naming scheme is consistent. The format of the name is:
<instance_name>.<arbitrary_string>.<region>.rds.amazonaws.com
The arbitrary_string
section of the name is a string that uniquely identifies your AWS account. All RDS instances created within your account will use the same string identifier, so just grab that section from an existing RDS instance and you can piece together the full name based on the name you give the database and the region you launch it in.
If you want to have an easy to read/remember DNS name then you can always use Route 53 to assign another name as an alias to this.
Upvotes: 1