-
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
[Bug]: aws_security_group_rule
: Changes to cidr_blocks
causes Error: [WARN] A duplicate Security Group rule was found
#38526
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Potential workarounds: GOOD: One rule per
|
For fans of history, the error message below was penned by Mitchell Hashimoto 9 years ago. Most error messages have moved to a more modern style. This one has been left as a tribute.
|
Question here: how do we enforce security group rule state, i.e. if someone creates a security group rule manually, how can we get Terraform to remove it? Using the aws_security_group |
This is a specific scenario related to a family of longstanding challenges with
aws_security_group
andaws_security_group_rule
causingA duplicate Security Group rule was found
. There are two purposes to this issue:IMPORTANT NOTE
We highly recommend using
aws_vpc_security_group_egress_rule
andaws_vpc_security_group_ingress_rule
instead ofaws_security_group_rule
. It may be useful to think ofaws_security_group_rule
as semi deprecated.Terraform Core Version
1.9.2
AWS Provider Version
5.59.0
Affected Resource(s)
Expected Behavior
Applying configuration should succeed recreating missing
cidr_blocks
.Actual Behavior
Applying the configuration, after an out-of-band change to the CIDR blocks, causes an error.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
References
There seem to be many error reports in the same neighborhood:
aws_security_group_rule
requires replacement when ordering ofcidr_blocks
argument changes #19082aws_security_group_rule
succeeds but is not recorded in state file #27024aws_security_group_rule
requires replacement when ordering ofcidr_blocks
argument changes #19082Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: