Due to a known issue with tags on the appautoscaling_target resource, as described in the Terraform documentation, this module includes a lifecycle rule to ignore changes to tags_all. This rule is defined in the main.tf file:
In my project, I use a combination of local tags and default_tags, and I instantiate the terraform-aws-rds-aurora module from within a custom module. Every time I run a plan, Terraform attempts to apply new tags added since the initial resource creation. However, due to the ignore_changes lifecycle rule, these tags are excluded from tags_all, which leads to the following issues:
Repeated Plan Outputs: Every Terraform plan shows the same tags to be applied, despite those tags not being included in the remote state due to the lifecycle rule.
Persisting Change Notifications: Even after applying, the plan still shows the same pending changes in every consecutive run.
Workaround Attempts
I've tried tainting and reapplying the resource, which correctly adds the tags and removes the change notification in future plans. However, this is not a viable solution as the tags are updated frequently, and tainting the resource for every change is impractical given the large number of resources using this module.
Proposed Solution
Would it be possible to make the lifecycle rule for ignore_changes on tags_all optional, or provide a way to remove it entirely? This would allow the tags to propagate to the remote state without requiring repeated tainting and redeployment.
Versions
Module version [Required]: 9.3.1 (originally used, but tried with latest 9.10.0 and still same issue)
Description
Due to a known issue with tags on the
appautoscaling_target
resource, as described in the Terraform documentation, this module includes a lifecycle rule to ignore changes totags_all
. This rule is defined in themain.tf
file:In my project, I use a combination of local tags and
default_tags
, and I instantiate theterraform-aws-rds-aurora
module from within a custom module. Every time I run a plan, Terraform attempts to apply new tags added since the initial resource creation. However, due to theignore_changes
lifecycle rule, these tags are excluded fromtags_all
, which leads to the following issues:Repeated Plan Outputs: Every Terraform plan shows the same tags to be applied, despite those tags not being included in the remote state due to the lifecycle rule.
Persisting Change Notifications: Even after applying, the plan still shows the same pending changes in every consecutive run.
Workaround Attempts
I've tried tainting and reapplying the resource, which correctly adds the tags and removes the change notification in future plans. However, this is not a viable solution as the tags are updated frequently, and tainting the resource for every change is impractical given the large number of resources using this module.
Proposed Solution
Would it be possible to make the lifecycle rule for
ignore_changes
ontags_all
optional, or provide a way to remove it entirely? This would allow the tags to propagate to the remote state without requiring repeated tainting and redeployment.Versions
Module version [Required]: 9.3.1 (originally used, but tried with latest 9.10.0 and still same issue)
Terraform version: v1.5.7
Provider version(s): v5.75.0
Reproduction Code [Required]
Steps to reproduce the behavior:
The Terraform plan output shows:
Expected behavior
The tags should be updated after applying, or add
tags
to ignore_changes lifecycle.