hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.65k stars 9.03k forks source link

Provide warning when `aws_security_group` in-line rules and `aws_security_group_rule` are detected for the same security group #12580

Open ghost opened 4 years ago

ghost commented 4 years ago

This issue was originally opened by @nhooey as hashicorp/terraform#24491. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.12.24

Expected Behavior

When Terraform runs, it should detect when an aws_security_group_rule is being added to an aws_security_group that already has inline rules, and warn the user.

Actual Behavior

Only the documentation warns the user.

References

The aws_security_group_rule documentation says:

NOTE on Security Groups and Security Group Rules: Terraform currently provides both a standalone Security Group Rule resource (a single ingress or egress rule), and a Security Group resource with ingress and egress rules defined in-line. At this time you cannot use a Security Group with in-line rules in conjunction with any Security Group Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.

It would also help if the documentation said "WARNING" instead of "note". Right now it kind of sounds like it's whispering "train"...

Jyots6914 commented 1 month ago

I will work on this and raise PR.