policies
Creates, updates, deletes, gets or lists a policies resource.
Overview
| Name | policies |
| Type | Resource |
| Id | azure.cdn.policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
customRules | object | Describes custom rules inside the policy. |
endpointLinks | array | Describes Azure CDN endpoints associated with this Web Application Firewall policy. |
etag | string | Gets a unique read-only string that changes whenever the resource is updated. |
extendedProperties | object | Key-Value pair representing additional properties for Web Application Firewall policy. |
location | string | The geo-location where the resource lives. Required. |
managedRules | object | Describes managed rules inside the policy. |
policySettings | object | Describes policySettings for policy. |
provisioningState | string | Provisioning state of the WebApplicationFirewallPolicy. Known values are: "Creating", "Succeeded", and "Failed". (Creating, Succeeded, Failed) |
rateLimitRules | object | Describes rate limit rules inside the policy. |
resourceState | string | Resource status of the policy. Known values are: "Creating", "Enabling", "Enabled", "Disabling", "Disabled", and "Deleting". (Creating, Enabling, Enabled, Disabling, Disabled, Deleting) |
sku | object | The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
customRules | object | Describes custom rules inside the policy. |
endpointLinks | array | Describes Azure CDN endpoints associated with this Web Application Firewall policy. |
etag | string | Gets a unique read-only string that changes whenever the resource is updated. |
extendedProperties | object | Key-Value pair representing additional properties for Web Application Firewall policy. |
location | string | The geo-location where the resource lives. Required. |
managedRules | object | Describes managed rules inside the policy. |
policySettings | object | Describes policySettings for policy. |
provisioningState | string | Provisioning state of the WebApplicationFirewallPolicy. Known values are: "Creating", "Succeeded", and "Failed". (Creating, Succeeded, Failed) |
rateLimitRules | object | Describes rate limit rules inside the policy. |
resourceState | string | Resource status of the policy. Known values are: "Creating", "Enabling", "Enabled", "Disabling", "Disabled", and "Deleting". (Creating, Enabling, Enabled, Disabling, Disabled, Deleting) |
sku | object | The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, policy_name, subscription_id | Retrieve protection policy with specified name within a resource group. | |
list | select | resource_group_name, subscription_id | Lists all of the protection policies within a resource group. | |
create_or_update | insert | resource_group_name, policy_name, subscription_id, location, sku | Create or update policy with specified rule set name within a resource group. | |
update | update | resource_group_name, policy_name, subscription_id | Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group. | |
create_or_update | replace | resource_group_name, policy_name, subscription_id, location, sku | Create or update policy with specified rule set name within a resource group. | |
delete | delete | resource_group_name, policy_name, subscription_id | Deletes Policy. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
policy_name | string | The name of the CdnWebApplicationFirewallPolicy. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
Retrieve protection policy with specified name within a resource group.
SELECT
id,
name,
customRules,
endpointLinks,
etag,
extendedProperties,
location,
managedRules,
policySettings,
provisioningState,
rateLimitRules,
resourceState,
sku,
systemData,
tags,
type
FROM azure.cdn.policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND policy_name = '{{ policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all of the protection policies within a resource group.
SELECT
id,
name,
customRules,
endpointLinks,
etag,
extendedProperties,
location,
managedRules,
policySettings,
provisioningState,
rateLimitRules,
resourceState,
sku,
systemData,
tags,
type
FROM azure.cdn.policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update policy with specified rule set name within a resource group.
INSERT INTO azure.cdn.policies (
tags,
location,
properties,
etag,
sku,
resource_group_name,
policy_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ etag }}',
'{{ sku }}' /* required */,
'{{ resource_group_name }}',
'{{ policy_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: policies
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the policies resource.
- name: policy_name
value: "{{ policy_name }}"
description: Required parameter for the policies resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the policies resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Properties of the web application firewall policy.
value:
policySettings:
enabledState: "{{ enabledState }}"
mode: "{{ mode }}"
defaultRedirectUrl: "{{ defaultRedirectUrl }}"
defaultCustomBlockResponseStatusCode: "{{ defaultCustomBlockResponseStatusCode }}"
defaultCustomBlockResponseBody: "{{ defaultCustomBlockResponseBody }}"
rateLimitRules:
rules:
- name: "{{ name }}"
enabledState: "{{ enabledState }}"
priority: {{ priority }}
matchConditions: "{{ matchConditions }}"
action: "{{ action }}"
rateLimitThreshold: {{ rateLimitThreshold }}
rateLimitDurationInMinutes: {{ rateLimitDurationInMinutes }}
customRules:
rules:
- name: "{{ name }}"
enabledState: "{{ enabledState }}"
priority: {{ priority }}
matchConditions: "{{ matchConditions }}"
action: "{{ action }}"
managedRules:
managedRuleSets:
- ruleSetType: "{{ ruleSetType }}"
ruleSetVersion: "{{ ruleSetVersion }}"
anomalyScore: {{ anomalyScore }}
ruleGroupOverrides: "{{ ruleGroupOverrides }}"
endpointLinks:
- id: "{{ id }}"
extendedProperties: "{{ extendedProperties }}"
provisioningState: "{{ provisioningState }}"
resourceState: "{{ resourceState }}"
- name: etag
value: "{{ etag }}"
description: |
Gets a unique read-only string that changes whenever the resource is updated.
- name: sku
description: |
The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. Required.
value:
name: "{{ name }}"
UPDATE examples
- update
Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group.
UPDATE azure.cdn.policies
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create or update policy with specified rule set name within a resource group.
REPLACE azure.cdn.policies
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
etag = '{{ etag }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND sku = '{{ sku }}' --required
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type;
DELETE examples
- delete
Deletes Policy.
DELETE FROM azure.cdn.policies
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;