Skip to content
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

Switch to using aws_vpc_security_group_ingress_rule for ingress on aws_security_group.sg #160

Open
JoeJasinski opened this issue Feb 23, 2024 · 0 comments

Comments

@JoeJasinski
Copy link

JoeJasinski commented Feb 23, 2024

Hi all, I believe that the aws_security_group.sg resource can be optimized to make more stable state calculations.

I believe that the AWS TF module recommends using individual rule resources for vpc_security_group_ingress_rule for defining security group ingresses. That way, a change to a single rule won't update every existing (untouched) rules in the security group.

For example, changing vars.allow_weka_api_cidrs invalidates ALL of the security group rules rather than just the one affecting given setting. Defining the rules as separate aws_vpc_security_group_ingress_rule resources would solve that problem.
aws_security_group.sg.

Here's the related code.

Here's the docs to the AWS resource
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_ingress_rule

@JoeJasinski JoeJasinski changed the title Switch to using aws_vpc_security_group_ingress_rule for ingress on aws_security_group.sg Switch to using aws_vpc_security_group_ingress_rule for ingress on aws_security_group.sg Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant