-
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
new resource: azurerm_firewall_policy_rule_collection_group #8603
new resource: azurerm_firewall_policy_rule_collection_group #8603
Conversation
3ffeee0
to
9e5627d
Compare
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 the PR @magodo - overall this is looking good and i've left some comments inline.
azurerm/internal/services/network/firewall_policy_rule_collection_group_data_source.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/firewall_policy_rule_collection_group_resource.go
Show resolved
Hide resolved
azurerm/internal/services/network/firewall_policy_rule_collection_group_resource.go
Show resolved
Hide resolved
azurerm/internal/services/network/firewall_policy_rule_collection_group_resource.go
Show resolved
Hide resolved
azurerm/internal/services/network/firewall_policy_rule_collection_group_resource.go
Show resolved
Hide resolved
website/docs/r/firewall_policy_rule_collection_group.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/firewall_policy_rule_collection_group.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/firewall_policy_rule_collection_group.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/firewall_policy_rule_collection_group.html.markdown
Outdated
Show resolved
Hide resolved
@katbyte I have updated the code per your review comments, please take another look! |
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.
Hi @magodo, this is looking great. I have one more suggestion and a couple questions below if you could help me understand some of the design decisions. Thanks!
Name string | ||
} | ||
|
||
func FirewallPolicyRuleCollectionGroupID(input string) (*FirewallPolicyRuleCollectionGroupId, error) { |
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.
Could you make this function use azure.ParseAzureResourceID
rather than depending on FirewallPolicyID
and a regex match?
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.
sure
return err | ||
} | ||
|
||
policyResp, err := policyClient.Get(ctx, id.ResourceGroup, id.PolicyName, "") |
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.
Why do we need to check the existence of the linked policy before retrieving the rule collection group?
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.
The reason is that we will need to use the policyResp
to set the firewall_policy_id
later. Instead, we should opt in to using the ID Formatter to save this API call.
ValidateFunc: validation.StringIsNotEmpty, | ||
}, | ||
}, | ||
"destination_address": { |
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.
Why do we accept a single address/CIDR when the API accepts a list?
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.
The API actually doesn't support a list, it will raise error:
Invalid DNat destination address. Multiple values, ranges and * are not supported.
@manicminer I have updated per your commments, please take another look, thank you! |
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.
@magodo Thanks, there's one other issue I noticed - can we store the subscription ID in the FirewallPolicyId
and FirewallPolicyRuleCollectionGroupId
structs, taking it from the original ID string, instead of passing it in afterwards?
@manicminer I assume you mean this part, this is actually how the |
@magodo Ah ok thanks. I still prefer the subscriptionId be sourced from the resource rather than from the client, but this looks good to merge 👍 |
@manicminer TBH, my first adoptions to the id structures imbedded the subscriptionId inside 😅 |
This has been released in version 2.35.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.35.0"
}
# ... other configuration ... |
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! |
Test Result
Related issue: #7319