-
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
metadata_options default not working properly in Launch Template #12564
Comments
@ewbankkit FYI - appreciate your work on this code but might need a small tweak |
@phils Thanks for opening this issue. |
In this case you must specify resource "aws_launch_template" "lt" {
name = "test-lt"
image_id = var.ami
instance_type = var.instance_type
user_data = base64encode(data.template_file.userdata.rendered)
key_name = var.key_name
vpc_security_group_ids = [aws_security_group.blah.id]
metadata_options {
http_endpoint = "enabled"
http_tokens = "required"
}
} |
I think the documentation should be updated in this case. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template#metadata-options says http_endpoint is optional which is misleading. |
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
http_endpoint has to be explicitly specified in the metadata_options block of the launch template terraform according to issue hashicorp/terraform-provider-aws#12564
Hey @phils 👋 Thank you for taking the time to file this. Given that there's been a number of AWS Provider releases since you initially filed it, can you confirm whether you're still experiencing this behavior? |
@justinretzolk I just experienced this behavior creating a |
Just ran into this as well with Some additional info:
I added the following to my Terraform:
And that fixed it. Unrelated: if you look at my output for |
Just ran into this for |
My team also just ran into this issue. Can we at least get an update in the documentation that says, " |
Same here using provider v4.47 and terraform-aws-modules/eks/aws v19.5.1. |
I'm only seeing this now (after PR creation)... Not sure if this backwards compatibility is still required? |
Hey all 👋 Thank you very much for taking the time to raise this! This was addressed with #30545, which was included in version |
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. |
Community Note
Terraform Version
Terraform v0.12.24
Affected Resource(s)
(maybe others using metadata options too)
Terraform Configuration Files
Expected Behavior
LT with metadata options as requested
Actual Behavior
Error: InvalidParameterValue: A value of ‘’ is not valid for http-endpoint. Valid values are ‘enabled’ or ‘disabled’.
This seems to be a common issue with launch template actions in terraform AWS Provider. When leaving items to 'default', I believe you must omit the variable altogether in the AWS API call, rather than sending blank string value.
Steps to Reproduce
metadata_options where http_endpoint is not specified in the tf code.
References
#12491
The text was updated successfully, but these errors were encountered: