I need to login to this instance to run customise code apart from user-data. This will basically create a dns record with bbbxre.ts.aws.com
How I can fetch the tag aws_instance.test-rhel-build.tags[“ts:wwid”] value and create another variable with aws_instance.test-rhel-build.tags[“ts:wwid”] + “.ts.aws.com” and make ssh to it?
The resource already exposes private_ip, public_ip and public_dns. Would those be sufficient to use?
Couldn’t the custom code part be loaded directly using the user-data?
Other options could be use of instance-metadata service so that the instance would write tags itself (requires instance profile and terraform skip additional tags).
Third option could be use of such an solution based on Route 53, Cloudwatch and Lambda.
Thank you for your response. Instance metadata have this tags information but while querying tags, unable to do so as it contains a character :. Setup is behind firewall, which does not allow ip address to login. It just allows internal fqdn. My question is how to query those tags to use it in other codes.