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

Improve resource lifecycle rule for tags #817

Open
robo-cap opened this issue Aug 31, 2023 · 0 comments
Open

Improve resource lifecycle rule for tags #817

robo-cap opened this issue Aug 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@robo-cap
Copy link
Member

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

all

Affected Resource(s)

All resources where the lifecycle includes defined_tags and freeform_tags without mentioning specific keys which may be updated.

Terraform Configuration Files

https://github.com/oracle-terraform-modules/terraform-oci-oke/blob/c23e645d351c9c6e963731854758da616eb073c1/modules/workers/nodepools.tf#L106C1-L106C41

other resources may have the same issue.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

Debug Output

Panic Output

Expected Behavior

When we update the defined tags for existing resources, I expect terraform to detect the changes and show the required actions as part of the plan.

Actual Behavior

Because we ignore defined_tags and freeform_tags as part of the lifecycle block, the changes related to tags on existing resources are ignored by terraform and not applied on terraform apply.

As part of the fix we should remove the freeform_tags from the lifecycle and be specific about the defined_tags with the changes we expect: defined_tags["Oracle-Tags.CreatedBy"], defined_tags["Oracle-Tags.CreatedOn"]

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@robo-cap robo-cap added the bug Something isn't working label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant