0
votes

AWS uses different DNS suffixes for certain regions. Most notable is us-east-1. For public IP addresses, the DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.com for the us-east-1 region, and ec2-public-ipv4-address.region.compute.amazonaws.com for other regions.

This is a simple enough rule to handle conditionally, or using a Mapping, but I wondered if CloudFormation offers a pseudo-parameter or some other way of returning directly what the complete suffix ought to be for a given region.

I'm aware of the AWS::URLSuffix parameter, which for most regions returns 'amazonaws.com', but that's not quite enough by itself.

1
I think you may have accidentally created route53 as a duplicate tag where amazon-route53 already exists. Please be mindful of this in the future, thank you!Maximillian Laumeister
No, I didn't create that tag.kbluck

1 Answers

1
votes

Use the Fn::GetAtt to get the Public DNS as mentioned in the Return Values here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#aws-properties-ec2-instance-returnvalues

{"Fn::GetAtt":["EC2LogicalResourceName","PublicDnsName"]}

Hope this helps