-
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
azurerm_application_gateway - support WAF Policies #6105
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.
hey @sirlatrom
Thanks for this PR :)
I've taken a look through and left a few comments inline but this is mostly looking good to me, if we can fix those up then this should otherwise be good 👍
Thanks!
azurerm/internal/services/network/resource_arm_application_gateway.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/resource_arm_application_gateway.go
Outdated
Show resolved
Hide resolved
@tombuildsstuff I applied your fixes, thanks for the review! |
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.
Hey @sirlatrom,
thanks for the PR. Iv'e left one question inline about simplifying the firewall_policy
to firewall_policy_id
. Its a SubResource
type so i think it makes sense.
azurerm/internal/services/network/resource_arm_application_gateway.go
Outdated
Show resolved
Hide resolved
Also see #6126 to be able to create said policies. |
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.
Hey @sirlatrom, thanks for that change. I've left some more comments that need attention - the docs need updating also could we set this property in the complete/another test? thanks!
if res, ok := d.GetOk("firewall_policy_id"); ok { | ||
vs := res.([]interface{}) | ||
id := vs[0].(string) | ||
gateway.ApplicationGatewayPropertiesFormat.FirewallPolicy = &network.SubResource{ | ||
ID: &id, | ||
} | ||
} |
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.
I think this can/should be
if res, ok := d.GetOk("firewall_policy_id"); ok { | |
vs := res.([]interface{}) | |
id := vs[0].(string) | |
gateway.ApplicationGatewayPropertiesFormat.FirewallPolicy = &network.SubResource{ | |
ID: &id, | |
} | |
} | |
if v, ok := d.GetOk("firewall_policy_id"); ok { | |
gateway.ApplicationGatewayPropertiesFormat.FirewallPolicy = &network.SubResource{ | |
ID: &utils.String(v.(string)), | |
} | |
} |
?
if setErr := d.Set("firewall_policy_id", flattenApplicationGatewayFirewallPolicy(props.FirewallPolicy)); setErr != nil { | ||
return fmt.Errorf("Error setting `firewall_policy_id`: %+v", setErr) | ||
} |
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.
given this is no longer a block or complex set we can:
if setErr := d.Set("firewall_policy_id", flattenApplicationGatewayFirewallPolicy(props.FirewallPolicy)); setErr != nil { | |
return fmt.Errorf("Error setting `firewall_policy_id`: %+v", setErr) | |
} | |
if props.FirewallPolicy !=nil { | |
d.Set("firewall_policy_id", props.FirewallPolicy.ID) | |
} |
@@ -167,6 +167,8 @@ The following arguments are supported: | |||
|
|||
* `custom_error_configuration` - (Optional) One or more `custom_error_configuration` blocks as defined below. | |||
|
|||
* `firewall_policy` - (Optional) A `firewall_policy` block as defined below. |
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.
and we'll need to update the docs here
I believe I've addressed the changes in 896fcb8. |
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 @sirlatrom, one last thing is could we set that property in a test?
@katbyte I've tried writing a test that sets the property, but when running the test it does not seem to matter what assertions I make, so maybe there's some documentation somewhere on what I can do to run the test properly? |
15907a5
to
d9d4d7f
Compare
Rebased on master to resolve conflicts. No manual merge work was needed. |
This comment has been minimized.
This comment has been minimized.
@katbyte I see this has been marked as included in v2.9.0, but it hasn't been merged as such. I suppose now the release has been cut, it would have to be moved to v2.10.0? |
Fixes hashicorp#4667. Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Co-Authored-By: Tom Harvey <[email protected]>
Co-Authored-By: Tom Harvey <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
…wall policy Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
Signed-off-by: Sune Keller <[email protected]>
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 @sirlatrom! LGTM 🙂
This has been released in version 2.10.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.10.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! |
Fixes #4667.