-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: aws_launch_template metadata_options instance_metadata_tags cannot be enabled #29209
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
It seems more linked with #25909 |
I had the same problem with v4.56.0 |
Got the same issue. |
I'll take a look at this |
I tested it and can reproduce it on the most current provider and the most current core version. After looking at the code I also tested the following parameters which are in the same If statement together.
After reading the documentation I don't see that any of these values are dependent on After moving these assignments out of the larger if statement and compiling locally I was able to successfully test. Test Code
Results in AWS ASG Launch Templates I'll take a swing at some acceptance tests after this. |
This functionality has been released in v4.61.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Terraform Core Version
1.3.7
AWS Provider Version
4.51.0
Affected Resource(s)
Expected Behavior
"Allow tags in metadata" in the launch template should be
enabled
wheninstance_metadata_tags
inmetadata_options
is set toenabled
.Actual Behavior
"Allow tags in metadata" in the launch template is unset when
instance_metadata_tags
inmetadata_options
is set toenabled
.Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
terraform init
terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
The comment in this this code on line 1141 hints at the solution to the problem: if you set
metadata_options.http_endpoint
toenabled
, theninstance_metadata_tags
being set toenabled
works. Otherwise, it results in the attribute being unset.Silently ignoring the
instance_metadata_tags
setting is less than ideal - an error or at least a warning should be raised if it's set but will be ignored becausehttp_endpoint
is disabled.This is especially frustrating because, according to the documentation for aws_launch_template, it says:
However, this appears to be untrue, based on the code:
No default value specified.
Good news is if I explicitly set
http_endpoint = "enabled"
theninstance_metadata_tags = "enabled"
works as expected/advertised.References
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: