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
Idaws.iot.policies

Fields

NameDatatypeDescription
idstring
arnstring
policy_documentobject
policy_namestring
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTPolicyDocument, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all policies in a region.

SELECT
region,
id,
arn,
policy_document,
policy_name,
tags
FROM aws.iot.policies
WHERE region = 'us-east-1';

Gets all properties from an individual policy.

SELECT
region,
id,
arn,
policy_document,
policy_name,
tags
FROM aws.iot.policies
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.iot.policies
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Create

iot:CreatePolicy,
iot:GetPolicy,
iot:TagResource,
iot:ListTagsForResource

Read

iot:GetPolicy,
iot:ListTagsForResource

Delete

iot:DeletePolicy,
iot:GetPolicy,
iot:ListPolicyVersions,
iot:DeletePolicyVersion

Update

iot:GetPolicy,
iot:ListPolicyVersions,
iot:CreatePolicyVersion,
iot:DeletePolicyVersion,
iot:SetDefaultPolicyVersion,
iot:TagResource,
iot:UntagResource,
iot:ListTagsForResource

List

iot:ListPolicies