-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Allow multiple instance expansion syntax when instance count is 1 #115
Comments
Could you just specify One issue with treating everything as having multiple resources is you get situations like this (which are equally unintuitive):
There's only ever one apex record, so indexing it feels cumbersome. Let me know if that works for you! |
Ah, sorry, misread part of your issue, |
Fixed! Thanks. |
Thanks! 🤘 |
Using the example config below setting up an ELB in front of a set of servers (in this case just 1). Trying to use the splat or expanded syntax (e.g.
${aws_instance.web.*.id}
) when count is 1 fails with an error but works fine ifcount >= 2
.The use case is to have a staging environment with just a single server and scaling that up in production. If we want to have just one instance we need to change the syntax we use depending on the environment or count.
Terraform should allow using the same syntax regardless of what the count it.
Running
terraform plan
errors with:Error running plan: Resource 'aws_instance.web' does not have attribute 'id' for variable 'aws_instance.web.*.id'
The text was updated successfully, but these errors were encountered: