-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Storage Account: Enable DefaultAction in Network rules. #3255
Storage Account: Enable DefaultAction in Network rules. #3255
Conversation
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.
Thanks for this PR :)
I've taken a look through and left some comments inline but this is off to a good start - if we can fix up the comments we should be able to run the tests and get this merged 👍
Thanks!
Removed default value. Made value case sensitive. Signed-off-by: ecp <[email protected]>
@tombuildsstuff Thanks for quick review. :) I have made the requested changes. I do agree |
I believe this happens because the rules itself are not deleted. Only the flag |
Indeed - because the NetworkRuleSet created when |
@tombuildsstuff Thanks for the pointer. However, I am not able to override those IP Rules/Virtual Network Rules even after specifying empty list. I tried the below snippet:
I dont know what I am missing. Can you please guide me here? |
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.
Thank you for the PR, this LGTM, however i am curious as to why you explicitly don't send the network rules when it is allow
. Will the API not be happy?
Added response in the comments. |
Add test when reverting default action from allow to deny. Signed-off-by: Ashish <[email protected]>
See my comment left inline. I am still wondering why you are conditionally setting the properties on create/update. Does the API throw an error if you set them? |
I hope you don't mind but i've pushed a commit demonstrating what I was referring to. I also changed the property to optional as a new required property in an existing block could potentially break peoples configuration. |
@katbyte Sorry for late response. I was on vacation for a bit and never really got back to this PR. Thanks so much for review and the commit. I am totally good with it. |
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.
LGTM now 👍
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Introduction: DefaultAction is the toggle which enables/disables network rules in azure storage account.
Setting it to
Deny
enables storage account firewall settings andAllow
disables the firewalls.Problem: When using azure storage account as module with
network_rules
block, there is no good way to disable network security apart from removing thenetwork_rules
block entirely from the root module.PR objective: This PR aims to solve this problem by implementing DefaultAction variable.
Storage Account - Module with
network_rules
block:Storage Account - Deployment 1 with no firewall:
Storage Account - Deployment 2 with firewall: