r/aws_launch_template: metadata_options issues #13506
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Note
The
metadata_options
is riddled with bugs. I started this PR to attempt to fix the specific case where you can't get rid of the metadata options by removing the block, i.e.:So this PR will fix that specific scenario, but this thing is so broken in so many other ways. Here are a couple of scenarios:
http_tokens
should be unset.The same problems exist with
aws_instance
. But it's even worse there since you can't unset the values like a launch template, they really need to be set back to the default. But since the notion ofDefault
values were rejected in my original PR (#11076), I can't imagine any sane way of fixing it without bringing that back.http_tokens
should be set to"optional"
, as if it was never specified in the first place.I don't agree with this comment by ewbankkit that says
The new metadata_options attribute is defined as Computed: true for backwards compatibility reasons
. If themetadata_options
block isn't specified, then theMetadataOptions
simply won't be set and the API call won't contain it.This PR will fix one tiny bug, but honestly, this thing needs an overhaul. It's so broken. In my opinion, the
aws_instance
resource cannot be fixed unless we make it aware of the defaults. It is like no one fully tested the end result.Output from acceptance testing: