fpco / terraform-aws-foundation

Establish a solid Foundation on AWS with these modules for Terraform
MIT License
204 stars 97 forks source link

Tagging ASG instances with Interpolation #194

Closed raghavanr closed 5 years ago

raghavanr commented 5 years ago

Hi,

Is there anyway we can tag instances which are being created by ASG in a sequential way like web-instance001, web-instance002, web-instance003 etc. Currently only tags associated with ASG are inherited.

any help is appreciated.

ketzacoatl commented 5 years ago

Hi @raghavanr,

I don't know of an easy way to do so, and it really should not matter, as there are other ways to meet the same end goals. More importantly, it's actually problematic to do that in an ASG. What is the purpose of sequential numbering for the ASG? What happens when you remove a few nodes and create new ones? What numbers do the new nodes get?

What I would recommend instead, is to use name/role tags, and then update the node hostnames to use the role and instance ID (which is the original hostname). In the UI, on the host over SSH, querying from the cli, etc, you get a cohesive experience across the board.

ketzacoatl commented 5 years ago

I'm going to close this for now, but feel free to re-open it if you have additional questions.