CmdID / aws / aws verifiedpermissions
aws verifiedpermissions create-policy-template
Creates a policy template. AWS CLI reference
1 example 5 options Its page in the AWS CLI reference
Examples
To create a policy template
The following create-policy-template example creates a policy template with a statement that contains a placeholder for the principal.
aws verifiedpermissions create-policy-template --statement file://template1.txt --policy-store-id PSEXAMPLEabcdefg111111Identify--statementSpecifies the content that you want to use for the new policy template, written in the Cedar policy language.--policy-store-idThe ID of the policy store in which to create the policy template.Contents of template1.txt:
permit(
principal in ?principal,
action == Action::"view",
resource == Photo::"VacationPhoto94.jpg"
);
Its output
{
"createdDate": "2023-06-12T20:47:42.804511+00:00",
"lastUpdatedDate": "2023-06-12T20:47:42.804511+00:00",
"policyStoreId": "PSEXAMPLEabcdefg111111",
"policyTemplateId": "PTEXAMPLEabcdefg111111"
}For more information about policy templates, see Amazon Verified Permissions policy templates in the Amazon Verified Permissions User Guide.
Options
--client-tokenSpecifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request.--descriptionSpecifies a description for the policy template.--nameSpecifies a name for the policy template that is unique among all policy templates within the policy store.--policy-store-idThe ID of the policy store in which to create the policy template.--statementSpecifies the content that you want to use for the new policy template, written in the Cedar policy language.