AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::VerifiedPermissions::Policy

CfnPolicy

Creates or updates a Cedar policy and saves it in the specified policy store. You can create either a static policy or a policy linked to a policy template. You can directly update only static policies. To update a template-linked policy, you must update its linked policy template instead. - To create a static policy, in the `Definition` include a `Static` element that includes the Cedar policy text in the `Statement` element. - To create a policy that is dynamically linked to a policy template, in the `Definition` include a `Templatelinked` element that specifies the policy template ID and the principal and resource to associate with this policy. If the policy template is ever updated, any policies linked to the policy template automatically use the updated template. > - If policy validation is enabled in the policy store, then updating a static policy causes Verified Permissions to validate the policy against the schema in the policy store. If the updated static policy doesn't pass validation, the operation fails and the update isn't stored. > - When you edit a static policy, You can change only certain elements of a static policy: > > - The action referenced by the policy. > - A condition clause, such as when and unless. > > You can't change these elements of a static policy: > > - Changing a policy from a static policy to a template-linked policy. > - Changing the effect of a static policy from permit or forbid. > - The principal referenced by a static policy. > - The resource referenced by a static policy. > - To update a template-linked policy, you must update the template instead.

Import

import { CfnPolicy } from 'aws-cdk-lib/aws-verifiedpermissions';

Or use the module namespace:

import * as verifiedpermissions from 'aws-cdk-lib/aws-verifiedpermissions';
// verifiedpermissions.CfnPolicy

Properties

Configuration passed to the constructor as CfnPolicyProps.

definitionRequired
IResolvable | PolicyDefinitionProperty

Specifies the policy type and content to use for the new or updated policy. The definition structure must include either a `Static` or a `TemplateLinked` element.

policyStoreIdRequired
string

Specifies the `PolicyStoreId` of the policy store you want to store the policy in.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-verifiedpermissions
CFN TypeAWS::VerifiedPermissions::Policy
Properties2

External Links