You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a new user, I didn't realize I had to use var. to reference a variable as in "${var.my-service-name}". This caused a lot of issues for me such as security group rules not being created, tags not being created, etc.
Terraform Version
Terraform v0.7.0
(I also had this issue in 0.6.14)
Affected Resource(s)
Potentially everything that you can reference a variable in.
Specifically, I experienced issues using improperly referenced variables in aws_subnet, aws_security_group.
Expected Behavior
I would expect terraform plan to throw an error and terraform apply to completely fail during execution.
There should be an error stating "Cannot reference my-sg-name in main.tf at 55:10"
Actual Behavior
Everything shows up as computed and tags and other fields simply are not created.
Talked this over with @phinze and I'm going to tag this with "0.8":
We'd like to break some backwards compatibility to fix this the right way. The "right way" we believe is to make it so that template_filesource parameter must be escaped if its a raw literal. The core ignores unprefixed variables (known internally as "simple" variables) only for this case and we think that wasn't the right decision.
However, this is a BC-incompat change so we will hold it until 0.8.
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.
ghost
locked and limited conversation to collaborators
Apr 20, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As a new user, I didn't realize I had to use
var.
to reference a variable as in"${var.my-service-name}"
. This caused a lot of issues for me such as security group rules not being created, tags not being created, etc.Terraform Version
Terraform v0.7.0
(I also had this issue in 0.6.14)
Affected Resource(s)
Potentially everything that you can reference a variable in.
Specifically, I experienced issues using improperly referenced variables in aws_subnet, aws_security_group.
Expected Behavior
I would expect
terraform plan
to throw an error andterraform apply
to completely fail during execution.There should be an error stating "Cannot reference
my-sg-name
in main.tf at 55:10"Actual Behavior
Everything shows up as computed and tags and other fields simply are not created.
Part of
mail.tf
:Output:
References
See @Zapadlo 's comment in GH-6265 about variables failing silently
The text was updated successfully, but these errors were encountered: