Skip to main content

policies

Creates, updates, deletes or gets a policy resource or lists policies in a region

Overview

Namepolicies
TypeResource
DescriptionResource Type definition for AWS::IoT::Policy
Idawscc.iot.policies

Fields

NameDatatypeDescription
idstring
arnstring
policy_documentobject
policy_namestring
tagsarray
regionstringAWS region.

For more information, see AWS::IoT::Policy.

Methods

NameResourceAccessible byRequired Params
create_resourcepoliciesINSERTPolicyDocument, region
delete_resourcepoliciesDELETEIdentifier, region
update_resourcepoliciesUPDATEIdentifier, PatchDocument, region
list_resourcespolicies_list_onlySELECTregion
get_resourcepoliciesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual policy.

SELECT
region,
id,
arn,
policy_document,
policy_name,
tags
FROM awscc.iot.policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new policy resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.iot.policies (
PolicyDocument,
region
)
SELECT
'{{ policy_document }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a policy resource, using stack-deploy.

/*+ update */
UPDATE awscc.iot.policies
SET PatchDocument = string('{{ {
"PolicyDocument": policy_document,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.iot.policies
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';

Permissions

To operate on the policies resource, the following permissions are required:

iot:CreatePolicy,
iot:GetPolicy,
iot:TagResource,
iot:ListTagsForResource,
kms:Decrypt