terraform-aws-modules / terraform-aws-security-group

Terraform module to create AWS Security Group resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws
Other
562 stars 1.08k forks source link

Prefix List being tied to ingress_with_self #292

Closed ryan-dyer-sp closed 1 year ago

ryan-dyer-sp commented 1 year ago

Description

The module references a PL within the ingress_with_self resource. This creates the self rule accordingly, but also has the unintended side effect of creating rules for PLs with the same ruleset. I would think the intention is to creates for self as defined and rules for PLs as defined. I can submit PR with fix, but want to confirm that the intent is correct. Thanks.

Example:

ingress_with_self       = [{ rule = "all-all" }]
ingress_rules           = ["https-443-tcp"]
ingress_prefix_list_ids = ["pl-id"]

This creates 3 ingress rules. An all self, an all PL, and an https PL. I would think the intent here is to create an all self, and an https PL rule. And as the resources intent is to create rules with self, I dont see any reason the PL should be set within the block. Locally I have removed this line (and the computed version) and this for us fixes all of these erroneous rules.

Versions

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.