-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Default Network ACL resource #6165
Conversation
Provides a resource to manage the default AWS Network ACL. VPC Only.
cc @clstokes |
Related to #6093. |
ForceNew: true, | ||
Computed: false, | ||
Deprecated: "Attribute subnet_id is deprecated on default_network_acl resources. Use subnet_ids instead", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new resource - why are we starting w/ a deprecated field? Perhaps just a leftover from basing this on the network_acl resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of a leftover. It was Computed
when I was "inheriting" the schema. I missed re-adding that change when I went to fully copying it over.
We're re-using resourceAwsNetworkAclRead
though, so it needs to be present. I'll mark it as Computed
for _, e := range networkAcl.Entries { | ||
// Skip the default rules added by AWS. They can be neither | ||
// configured or deleted by users. | ||
if *e.RuleNumber == 32767 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you lift this number up into a constant.
Refactor method to delete all network ACL entries, regardless of type. The previous implementation was under the assumption that we may only eliminate some rule types and possibly not others, so the split was necessary. We're now removing them all, so the logic isn't necessary Several doc and test cleanups are here as well
7abb13a
to
af367a4
Compare
"subnet_id": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a read through Read
(ha!) on network ACL and didn't see the subnet_id field mentioned there. Looks like it's only referenced in Delete
and Update
, nether of which we borrow. So I think that means we can drop this without consequence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smote in 78cd903
Ok last pass complete - just those docs Qs and the subnet_id Q |
LGTM! |
Passing acceptance tests, merging
|
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. |
Provides a resource to manage the default AWS Network ACL. This resource is VPC Only.
The
aws_default_network_acl
behaves differently from normal resources, in thatTerraform does not create this resource, but instead attempts to "adopt" it
into management. We can do this because each VPC created has a Default Network
ACL that cannot be destroyed, and is created with a known set of default rules.
When Terraform first adopts the Default Network ACL, it immeidately removes all
rules in the ACL. It then proceeds to create any rules specified in the
configuration. This step is required so that only the rules specificed in the
configuration are created.
Example: Default Network ACL, with default rules in place:
Example: Default Network ACL, denying all traffic:
For more information about Network ACLs, including the default, see the AWS Documentation on Network ACLs.
Fixes #5971