Skip to content
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 can't have "aws-node-termination-handler/managed" as a key #30166

Closed
ba-work opened this issue Mar 21, 2023 · 5 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. tags Pertains to resource tagging.
Milestone

Comments

@ba-work
Copy link

ba-work commented Mar 21, 2023

Terraform Core Version

1.4.2

AWS Provider Version

4.59.0

Affected Resource(s)

  • aws_launch_template

Expected Behavior

When I add the tag "aws-node-termination-handler/managed" to an aws_launch_template, it gets added to the AWS resource.

Actual Behavior

The tag doesn't get added to the AWS resource.

Relevant Error/Panic Output Snippet

2023-03-21T15:06:35.297-0400 [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value for aws_launch_template.a, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .tags_all: element "aws-node-termination-handler/managed" has vanished
      - .tags: element "aws-node-termination-handler/managed" has vanished

Terraform Configuration Files

resource "aws_launch_template" "a" { tags = { "aws-node-termination-handler/managed" = "" } }

Steps to Reproduce

terraform apply the above config.

Debug Output

The provider is stripping the tag and not POSTing at all:

2023-03-21T15:12:58.065-0400 [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value for aws_launch_template.a, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .tags: element "aws-node-termination-handler/managed" has vanished
      - .tags_all: element "aws-node-termination-handler/managed" has vanished
2023-03-21T15:12:58.065-0400 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for aws_launch_template.a
2023-03-21T15:12:58.065-0400 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: writing state object for aws_launch_template.a
2023-03-21T15:12:58.066-0400 [TRACE] evalApplyProvisioners: aws_launch_template.a is not freshly-created, so no provisioning is required
2023-03-21T15:12:58.066-0400 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for aws_launch_template.a
2023-03-21T15:12:58.066-0400 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: writing state object for aws_launch_template.a
aws_launch_template.a: Modifications complete after 0s [id=lt-03071de98889e820a]

Panic Output

N/A

Important Factoids

Nothing important, this is minimally reproducible.

References

kops attempts to add this tag to the launch templates when you enable the node-termination-handler, which is what revealed this bug. However it's easy enough to manually reproduce with a single line of Terraform.

Would you like to implement a fix?

No

@ba-work ba-work added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Mar 21, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/ec2 Issues and PRs that pertain to the ec2 service. label Mar 21, 2023
@ewbankkit
Copy link
Contributor

Relates #24449.

@ewbankkit ewbankkit added tags Pertains to resource tagging. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 11, 2023
@ewbankkit ewbankkit added this to the v5.0.0 milestone May 11, 2023
@johnsonaj
Copy link
Contributor

Resolved in #30793. Merged to main in #31392

@github-actions
Copy link

This functionality has been released in v5.0.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!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. tags Pertains to resource tagging.
Projects
None yet
Development

No branches or pull requests

3 participants