policies
Creates, updates, deletes, gets or lists a policies
resource.
Overview
Name | policies |
Type | Resource |
Id | azure.dev_test_labs.policies |
Fields
- vw_policies
- policies
Name | Datatype | Description |
---|---|---|
id | text | The identifier of the resource. |
name | text | The name of the resource. |
description | text | field from the properties object |
created_date | text | field from the properties object |
evaluator_type | text | field from the properties object |
fact_data | text | field from the properties object |
fact_name | text | field from the properties object |
labName | text | field from the properties object |
location | text | The location of the resource. |
policySetName | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
status | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | The tags of the resource. |
threshold | text | field from the properties object |
type | text | The type of the resource. |
unique_identifier | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
location | string | The location of the resource. |
properties | object | Properties of a Policy. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | labName, name, policySetName, resourceGroupName, subscriptionId | Get policy. |
list | SELECT | labName, policySetName, resourceGroupName, subscriptionId | List policies in a given policy set. |
create_or_update | INSERT | labName, name, policySetName, resourceGroupName, subscriptionId, data__properties | Create or replace an existing policy. |
delete | DELETE | labName, name, policySetName, resourceGroupName, subscriptionId | Delete policy. |
update | UPDATE | labName, name, policySetName, resourceGroupName, subscriptionId | Allows modifying tags of policies. All other properties will be ignored. |
SELECT
examples
List policies in a given policy set.
- vw_policies
- policies
SELECT
id,
name,
description,
created_date,
evaluator_type,
fact_data,
fact_name,
labName,
location,
policySetName,
provisioning_state,
resourceGroupName,
status,
subscriptionId,
tags,
threshold,
type,
unique_identifier
FROM azure.dev_test_labs.vw_policies
WHERE labName = '{{ labName }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.policies
WHERE labName = '{{ labName }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.dev_test_labs.policies (
labName,
name,
policySetName,
resourceGroupName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ policySetName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: description
value: string
- name: status
value: string
- name: factName
value: string
- name: factData
value: string
- name: threshold
value: string
- name: evaluatorType
value: string
- name: createdDate
value: string
- name: provisioningState
value: string
- name: uniqueIdentifier
value: string
UPDATE
example
Updates a policies
resource.
/*+ update */
UPDATE azure.dev_test_labs.policies
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified policies
resource.
/*+ delete */
DELETE FROM azure.dev_test_labs.policies
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND policySetName = '{{ policySetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';