-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Changing the name of an AWS Config Rule creates a duplicate rule #4427
Comments
Can confirm this is still an issue on 2.23. It would seem the fix here is to make a name change on the resource force recreation. |
Any chances for resolution? This bug is also available on: |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
It looks like #15136 is still open to fix this, and that this is therefore not stale? |
Hi I can confirm this issue is still happening with Terraform v1.6.5 and aws provider v5.37. Is there an ETA for the fix? A tricky workaround to this could be using both null_resource + replace_triggered_by lifecylce meta-argument. locals {
rule_name = "my-rule-name"
}
resource "null_resource" "config_rule_trigger" {
triggers = {
rule_name = local.rule_name
}
}
resource "aws_config_config_rule" "config_rule" {
name = local.rule_name
# ... other configuration ...
lifecycle {
replace_triggered_by = [null_resource.config_rule_trigger]
}
} Of course ideally this behaviour is achieved nativelly by the tf resource :) |
This functionality has been released in v5.39.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! |
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. |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/jbscare/daa09aceb771e8d6cddcb9931d83e396
Expected Behavior
When I created a Config Rule with a name that had a typo, and then fixed the typo in the name, I expected the Rule's name to change.
Actual Behavior
Terraform created a second Config rule, leaving the old one around.
Steps to Reproduce
I started with no "jbstest" config rules:
I created one:
Now I've got a jbstest Config Rule:
I spot a typo in the name, and fix my .tf.json file:
The only difference from before is the 'name' parameter.
terraform plan
looks good, it just wants to change the name:I apply that:
But now I've got two jbstest Config Rules:
Important Factoids
none
References
none
The text was updated successfully, but these errors were encountered: