-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom tags where count.index is used (iteration) #1
Comments
Yes, you need to modify this module, because you need to access |
Thank you, Anton. FYI, my modification looks like this, in case you or anyone else might have a thought about how to generalize this.
|
Thanks! Looks scary :) I normally (for 99.9% of cases) use auto-scaling groups and set EC2 tags from instance itself if necessary. |
Haha. Sorry. I'm a nubie so perhaps it's overkill. I get tired of looking at so many things in AWS and trying to figure our which system they're associated. So I'm a bit obsessive trying to apply, for example, the actual fqdn of the instance in the Name field. I am also using the iterative count mechanism to build multiple variants of the same instances. So not every instance is using it's own unique resource definition. While I'm developing for AWS now, I'm also trying to keep from going too deep into AWS, because we'll also need t support the same infrastructure on private cloud openstack. If I can't create it in AWS and Openstack, I need to be careful what I use in AWS so I don't paint us into a corner. Thanks so much for your help and advice. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm trying to generate various FQDN names that have different conventions.
I had a highly modified (from previous version) and I used the
count
andcount.index
to determine how many iterations to make and created the names accordingly.Here are the variations:
For example, the
db
and theax
are iterated on the host_name when count is greater than 1.Here's what my tag block looked like inside the instance resource:
...
I'm guessing, to keep this functionality, my only option is to modify this module; the main.tf file in
resource "aws_instance" "this"
Thanks for any tips,
Chris.
The text was updated successfully, but these errors were encountered: