-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
manage_default_security_group with empty eg/ingress doesn't remove rules #759
Comments
I think what you are referring to is hashicorp/terraform-provider-aws#3234 rules that are added manually, outside of Terraform's control, are not detected for deletion There are also some other issues that might be related, but they are constrained to the provider, not this module: |
@bryantbiggs Is this not this module?
I'm checking right now to see if I get anything different using:
|
OK, it looks like from doing more reading that the behavior I desire is simply not possible, whether it be with the VPC module or the |
@spanktar AFAIK, using
And then do: I get:
|
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. |
Description
If you have existing VPCs with default SGs and want to bring them under management in order to remove the default SG's rules, you cannot. When the VPC is created, its default SG has default ingress & egress rules. I would expect that the following would remove them (and maintain that state).
Instead, existing rules remain. I also tested creating a new VPC with the default SG managed by the module as shown above, and then went and added an ingress rule manually. On the next TF apply, it did not remove the rule, as would be expected.
We need to manage, and maintain, the default SG to be empty, and I can't seem to find a way to accomplish that with the way it currently works.
Versions
Reproduction
Create a new VPC with this module, with the manage_default options set.
Apply
Manually add a rule to the default SG
Apply
The new rule is not removed.
Code Snippet to Reproduce
Expected behavior
When a VPC's default SG comes under "management", it should respect the defined rules, even if the rules are empty:
[]
Actual behavior
The empty rules defined the default security group are not respected. Manually added rules presist.
Additional context
This is becoming a more and more common request from cloud vulnerability scanners (the actual validity of this can be argued elsewhere), so it's important to be able to maintain a default SG with no ingress or egress rules.
Updating to the latest version: 3.12.0 did not seem to change the behavior.
Also upgraded TF to 1.1.6 with no change.
The text was updated successfully, but these errors were encountered: