Setting tags to have empty values or changing tags from having a value to having no value is not correctly handled #24449
Labels
bug
Addresses a defect in current functionality.
service/acm
Issues and PRs that pertain to the acm service.
service/apigateway
Issues and PRs that pertain to the apigateway service.
service/configservice
Issues and PRs that pertain to the configservice service.
service/ec2
Issues and PRs that pertain to the ec2 service.
service/events
Issues and PRs that pertain to the events service.
service/firehose
Issues and PRs that pertain to the firehose service.
service/iam
Issues and PRs that pertain to the iam service.
service/kms
Issues and PRs that pertain to the kms service.
service/lambda
Issues and PRs that pertain to the lambda service.
service/logs
Issues and PRs that pertain to the logs service.
service/rds
Issues and PRs that pertain to the rds service.
service/s3
Issues and PRs that pertain to the s3 service.
service/secretsmanager
Issues and PRs that pertain to the secretsmanager service.
service/sns
Issues and PRs that pertain to the sns service.
service/sqs
Issues and PRs that pertain to the sqs service.
service/vpc
Issues and PRs that pertain to the vpc service.
service/wafv2
Issues and PRs that pertain to the wafv2 service.
tags
Pertains to resource tagging.
Milestone
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform version 0.14.7
AWS provider version v4.11.0
Affected Resource(s)
Multiple. Examples of this issue have been seen in:
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
First scenario:
Output of
terraform plan
upon creation:Every subsequent output of
terraform plan
:Second scenario:
First step:
Output:
Second step -
terraform apply
these changes:Every subsequent output of
terraform plan
:Debug Output
I apologise but I cannot get the debug output without some decent amount of research into what needs to be obfuscated in the API calls to AWSand potentially other sensitive information. If you believe this is essential for debugging this issue as you cannot replicate, I will look into what I can do
Panic Output
Expected Behavior
First scenario
Upon the first
terraform apply
, the S3 bucket should have the "example" tag set with no value.A subsequent run of
terraform apply
should not attempt to change the resource from its initial state (the one it was left in after the firstterraform apply
)Second scenario
For the first step, upon the first
terraform apply
, the S3 bucket should have the "example" tag set with the value of "something".For the second step, upon the
terraform apply
the S3 bucket should have the "example" tag changed to have no value (not the same as tag deletion)A subsequent run of
terraform apply
should not attempt to change the resource from its previous state (the one it was left in after the lastterraform apply
)Actual Behavior
First scenario
Upon the first
terraform apply
, the AWS bucket is created with no tagsEvery subsequent run of
terraform apply
attempts to add the "example" tag but that seems to never happen (no errors shown though, Terraform is happy and assumes that everything went well)Second scenario
For the first step, everything goes as planned and the S3 bucket is created with the "example" tag set with the value of "something".
For the second step, upon the
terraform apply
the S3 bucket does not change the state of the "example" tag and it is left with the value of "something"Every subsequent run of
terraform apply
attempts to change the "example" tag but that seems to never happen (no errors shown though, Terraform is happy and assumes that everything went well)Steps to Reproduce
First scenario
terraform apply
terraform apply
Second scenario
terraform apply
terraform apply
terraform apply
Important Factoids
This has been seen on a few really old accounts from what I am aware of so I would not be surprised if this has to do with the account setup. I can have an ask if you know what might be useful to know about (I am not the account owner)
References
The text was updated successfully, but these errors were encountered: