-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
aws_instance tags don't get created or updated #6265
Comments
Hi @yanatan16! Thanks for the detailed report here. This is an interesting bug - tags are tested as part of our acceptance testing suites and are widely used. My first guess reading your config is that issue lies with the interpolation - particularly the element. This should work - but as a potential workaround (and probably clearer code) why not perform the string formatting directly in the tag rather than via a |
I understand this is probably a configuration error, being unable to set the "Name" tag would be a pretty big regression. I edited the tags to use regular interpolation with no function calls (no format), but still no luck. Same output and results.
|
Alas @jen20, I have found the bug. |
Hi @yanatan16 - yes I'd agree this is a bug. I'm going to test this against the |
As an update: I have the following simpler repro on this: variable "role" {
default = "testrole"
}
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
tags {
Role = "test-${role}"
}
} My current working theory is that the |
@jen20 I just ran into this with a build off master. |
Saw the same thing, left out |
This is fixed with 0.7.2! |
EH, correction: I fixed another var prefix issue in 0.7.2. This appears to still be happening. Centralizing work/feedback on #8010. |
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. |
Problem
AWS Instance tags never get applied, even after repeated
terraform apply
.terraform plan
always reports that the tags are empty and need to be set:Background
Terraform Version:
Terraform v0.6.14
OS: OSX
Affected Resources:
aws_instance
Configuration
This is the primary module being used with a few different roles:
Debug Output
https://gist.github.com/yanatan16/b9a8517939c92e262ac2b48d03f48a7a
Expected Behavior
Tags should be applied to instances.
Actual Behavior
No tags exist in EC2 console,
terraform plan
reports changed tags.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform plan
The text was updated successfully, but these errors were encountered: