Skip to content
v2.274.0

CfnPolicyPropsMixin Mixin ​

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.

Initializer ​

ts
new CfnPolicyPropsMixin(props: CfnPolicyMixinProps, options?: CfnPropertyMixinOptions)
python
CfnPolicyPropsMixin(props: CfnPolicyMixinProps, options: typing.Optional[CfnPropertyMixinOptions] = None)
java
new CfnPolicyPropsMixin(CfnPolicyMixinProps props, CfnPropertyMixinOptions options)
csharp
new CfnPolicyPropsMixin(CfnPolicyMixinProps props, CfnPropertyMixinOptions? options = null)
go
NewCfnPolicyPropsMixin(Props CfnPolicyMixinProps, Options CfnPropertyMixinOptions)

Methods ​

applyTo(construct: IConstruct): voiddef apply_to(self, construct: IConstruct) -> Nonepublic void applyTo(IConstruct construct)public void ApplyTo(IConstruct construct)func ApplyTo(Construct IConstruct)#
Apply the mixin properties to the construct.
isMixin(x: any): boolean@staticmethod def is_mixin(x: Any) -> boolpublic static Boolean isMixin(Object x)public static bool IsMixin(object x)func IsMixin(X interface{}) *boolstatic#
Checks if `x` is a Mixin.
1 parameter · returns

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Mixin.

supports(construct: IConstruct): booleandef supports(self, construct: IConstruct) -> boolpublic Boolean supports(IConstruct construct)public bool Supports(IConstruct construct)func Supports(Construct IConstruct) *bool#
Check if this mixin supports the given construct.