New Resource: azurerm_application_load_balancer_security_policy#30128
New Resource: azurerm_application_load_balancer_security_policy#30128catriona-m merged 4 commits intohashicorp:mainfrom
azurerm_application_load_balancer_security_policy#30128Conversation
azurerm_application_load_balancer_security_policyazurerm_application_load_balancer_security_policy
ms-zhenhua
left a comment
There was a problem hiding this comment.
Hi @teowa ,
Thanks for this PR - I've taken a look through and left some comments inline. If we can fix those up, this should be good to go 👍
|
|
||
| resp, err := clients.ServiceNetworking.SecurityPoliciesInterface.Get(ctx, *id) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("retrieving %q: %+v", *id, err) |
There was a problem hiding this comment.
| return nil, fmt.Errorf("retrieving %q: %+v", *id, err) | |
| return nil, fmt.Errorf("retrieving %s: %+v", *id, err) |
| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9]([a-zA-Z0-9_.-]{0,62}[a-zA-Z0-9])?$`), "`name` must begin with a letter or number, end with a letter and number, and must be between 1 and 64 characters long and can only contain letters, numbers, underscores(_), periods(.), and hyphens(-)."), |
There was a problem hiding this comment.
| ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9]([a-zA-Z0-9_.-]{0,62}[a-zA-Z0-9])?$`), "`name` must begin with a letter or number, end with a letter and number, and must be between 1 and 64 characters long and can only contain letters, numbers, underscores(_), periods(.), and hyphens(-)."), | |
| ValidateFunc: validation.StringMatch( | |
| regexp.MustCompile(`^[a-zA-Z0-9]([a-zA-Z0-9_.-]{0,62}[a-zA-Z0-9])?$`), | |
| "`name` must begin with a letter or number, end with a letter and number, and must be between 1 and 64 characters long and can only contain letters, numbers, underscores(_), periods(.), and hyphens(-).", | |
| ), |
| if model := resp.Model; model != nil { | ||
| if prop := model.Properties; prop != nil { | ||
| if wafPolicy := prop.WafPolicy; wafPolicy != nil { | ||
| state.WebApplicationFirewallPolicyId = wafPolicy.Id |
There was a problem hiding this comment.
wafPolicy.Id from API response should be parsed insensitively before assigned to the state. please refer to
|
Hi @ms-zhenhua , thanks for reviewing this, I have updated the code, please kindly take another look! |
ms-zhenhua
left a comment
There was a problem hiding this comment.
Hi @teowa ,
Thanks for your updates. LGTM~
catriona-m
left a comment
There was a problem hiding this comment.
HI @teowa thanks for adding this. I left a few comments inline but once these are addressed I can take another look. Thanks!
| %s | ||
|
|
||
| resource "azurerm_application_load_balancer_security_policy" "test" { | ||
| name = "acct-albsp-%d" |
There was a problem hiding this comment.
| name = "acct-albsp-%d" | |
| name = "acctest-albsp-%d" |
| %s | ||
|
|
||
| resource "azurerm_application_load_balancer_security_policy" "test" { | ||
| name = "acct-albsp-%d" |
There was a problem hiding this comment.
| name = "acct-albsp-%d" | |
| name = "acctest-albsp-%d" |
| %s | ||
|
|
||
| resource "azurerm_application_load_balancer_security_policy" "test" { | ||
| name = "acct-albsp-%d" |
There was a problem hiding this comment.
| name = "acct-albsp-%d" | |
| name = "acctest-albsp-%d" |
| } | ||
| resource "azurerm_application_load_balancer_security_policy" "example" { |
There was a problem hiding this comment.
nit, but could we space this out?
| } | |
| resource "azurerm_application_load_balancer_security_policy" "example" { | |
| } | |
| resource "azurerm_application_load_balancer_security_policy" "example" { |
| layout: "azurerm" | ||
| page_title: "Azure Resource Manager: azurerm_application_load_balancer_security_policy" | ||
| description: |- | ||
| Manages an Application Gateway for Containers Security Policy. |
There was a problem hiding this comment.
| Manages an Application Gateway for Containers Security Policy. | |
| Manages an Application Load Balancer Security Policy. |
|
|
||
| * `web_application_firewall_policy_id` - (Required) The ID of the Web Application Firewall Policy. Changing this forces a new Application Gateway for Containers Security Policy to be created. | ||
|
|
||
| * `location` - (Required) The Azure Region where the Application Gateway for Containers Security Policy should exist. Changing this forces a new resource to be created. |
There was a problem hiding this comment.
| * `location` - (Required) The Azure Region where the Application Gateway for Containers Security Policy should exist. Changing this forces a new resource to be created. | |
| * `location` - (Required) The Azure Region where the Application Load Balancer Security Policy should exist. Changing this forces a new resource to be created. |
|
|
||
| --- | ||
|
|
||
| * `tags` - (Optional) A mapping of tags which should be assigned to the Application Gateway for Containers Security Policy. |
There was a problem hiding this comment.
| * `tags` - (Optional) A mapping of tags which should be assigned to the Application Gateway for Containers Security Policy. | |
| * `tags` - (Optional) A mapping of tags which should be assigned to the Application Load Balancer Security Policy. |
|
|
||
| In addition to the Arguments listed above - the following Attributes are exported: | ||
|
|
||
| * `id` - The ID of the Application Gateway for Containers Security Policy. |
There was a problem hiding this comment.
| * `id` - The ID of the Application Gateway for Containers Security Policy. | |
| * `id` - The ID of the Application Load Balancer Security Policy. |
| * `create` - (Defaults to 30 minutes) Used when creating the Application Gateway for Containers Security Policy. | ||
| * `read` - (Defaults to 5 minutes) Used when retrieving the Application Gateway for Containers Security Policy. | ||
| * `delete` - (Defaults to 30 minutes) Used when deleting the Application Gateway for Containers Security Policy. |
There was a problem hiding this comment.
| * `create` - (Defaults to 30 minutes) Used when creating the Application Gateway for Containers Security Policy. | |
| * `read` - (Defaults to 5 minutes) Used when retrieving the Application Gateway for Containers Security Policy. | |
| * `delete` - (Defaults to 30 minutes) Used when deleting the Application Gateway for Containers Security Policy. | |
| * `create` - (Defaults to 30 minutes) Used when creating the Application Load Balancer Security Policy. | |
| * `read` - (Defaults to 5 minutes) Used when retrieving the Application Load Balancer Security Policy | |
| * `delete` - (Defaults to 30 minutes) Used when deleting the Application Load Balancer Security Policy. |
|
|
||
| ## Import | ||
|
|
||
| Application Gateway for Containers Security Policy can be imported using the `resource id`, e.g. |
There was a problem hiding this comment.
| Application Gateway for Containers Security Policy can be imported using the `resource id`, e.g. | |
| Application Load Balancer Security Policy can be imported using the `resource id`, e.g. |
|
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. |

Community Note
Description
Swagger: https://github.com/Azure/azure-rest-api-specs/blob/a36e0cfbbbdde5019c401f26bec53cca9d6d2dda/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/TrafficController.json#L1086
PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_application_load_balancer_security_policy[GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.