-
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
Fix/make azurerm_firewall_policy
premium tier features available
#12769
Fix/make azurerm_firewall_policy
premium tier features available
#12769
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 @gro1m - aside from one comment about schema and the docs need to be updated i think this looks good!
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 @gro1m - looks good! just. need to fix up the tests and this should be good to go:
Test ended in panic.
------- Stdout: -------
=== RUN TestAccFirewallPolicy_requiresImport
=== PAUSE TestAccFirewallPolicy_requiresImport
=== CONT TestAccFirewallPolicy_requiresImport
------- Stderr: -------
panic: Invalid address to set: []string{"transport_security"}
goroutine 450 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc0001b4e80, 0x60b5bc9, 0x12, 0x56b5060, 0xc0022d9698, 0x0, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:230 +0x371
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/firewall.resourceFirewallPolicyRead(0xc0001b4e80, 0x585b660, 0xc000a57880, 0x0, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/azurerm/internal/services/firewall/firewall_policy_resource.go:430 +0xb53
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/firewall.resourceFirewallPolicyCreateUpdate(0xc0001b4e80, 0x585b660, 0xc000a57880, 0x0, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/azurerm/internal/services/firewall/firewall_policy_resource.go:377 +0xdb0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0002bfce0, 0x6837788, 0xc00118f8c0, 0xc0001b4e80, 0x585b660, 0xc000a57880, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:318 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0002bfce0, 0x6837788, 0xc00118f8c0, 0xc001526b60, 0xc002076ce0, 0x585b660, 0xc000a57880, 0x0, 0x0, 0x0, ...)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:456 +0x67b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0028b53e0, 0x6837788, 0xc00118f8c0, 0xc0032b25a0, 0xc00118f8c0, 0x5d50440, 0xc003661e00)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:955 +0x8ef
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc002112cc0, 0x6837830, 0xc00118f8c0, 0xc0015268c0, 0xc002112cc0, 0xc003661e90, 0xc001cd9ba0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:332 +0xb5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x5d50440, 0xc002112cc0, 0x6837830, 0xc003661e90, 0xc001b1c8a0, 0x0, 0x6837830, 0xc003661e90, 0xc0019fc400, 0x3a0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000d4efc0, 0x6884018, 0xc002406a80, 0xc001902b40, 0xc0014ac390, 0x9e2d9a0, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/google.golang.org/grpc/server.go:1292 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc000d4efc0, 0x6884018, 0xc002406a80, 0xc001902b40, 0x0)
/opt/teamcity-agent/work/a73be106926a7472/vendor/google.golang.org/grpc/server.go:1617 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0035b01b0, 0xc000d4efc0, 0x6884018, 0xc002406a80, 0xc001902b40)
/opt/teamcity-agent/work/a73be106926a7472/vendor/google.golang.org/grpc/server.go:940 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
/opt/teamcity-agent/work/a73be106926a7472/vendor/google.golang.org/grpc/server.go:938 +0x1fd
@katbyte Adressed in latest commit :) |
Thanks @gro1m - checked the tests results and am now seeing :
|
Hi @manicminer @katbyte
Could you help me fix this please? |
Hi @gro1m, you're on the right track. The For example: func flattenFirewallPolicyIntrusionDetection(input *network.FirewallPolicyIntrusionDetection) []interface{} {
if input == nil {
return []interface{}{}
}
signatureOverrides := make([]interface{}, 0)
if overrides := input.Configuration.SignatureOverrides; overrides != nil {
for _, override := range *overrides {
id := ""
if override.ID != nil {
id = *override.ID
}
signatureOverrides = append(signatureOverrides, map[string]interface{}{
"id": id,
"state": string(override.Mode),
})
}
}
return []interface{}{
map[string]interface{}{
"mode": string(input.Mode),
"signature_overrides": signatureOverrides,
// ...
},
}
} (Noting that fields stored as pointers are first defaulted, then dereferenced if not nil) |
Hi @manicminer |
@gro1m Thanks, that seems to work. I removed the lifecycle blocks from the test configs and made the The |
Hi @manicminer |
OK, I'll give it a try. The values in the example output
|
Hi @manicminer using
And otherwise I will proceed as documented in the following and do not submit a certificate: At the moment I did not do it correctly, as it seems :) |
@manicminer |
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.
@gro1m Great work! The tests are passing and the changes LGTM
This functionality has been released in v2.74.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Related Issues:
What could/has to be still improved: