CfnRolePolicyPropsMixin

class aws_cdk.mixins_preview.aws_iam.mixins.CfnRolePolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

Adds or updates an inline policy document that is embedded in the specified IAM role.

When you embed an inline policy in a role, the inline policy is used as part of the role’s access (permissions) policy. The role’s trust policy is created at the same time as the role, using `CreateRole <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html>`_ . You can update a role’s trust policy using `UpdateAssumeRolePolicy <https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAssumeRolePolicy.html>`_ . For information about roles, see IAM roles in the IAM User Guide .

A role can also have a managed policy attached to it. To attach a managed policy to a role, use `AWS::IAM::Role <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html>`_ . To create a new managed policy, use `AWS::IAM::ManagedPolicy <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html>`_ . For information about policies, see Managed policies and inline policies in the IAM User Guide .

For information about the maximum number of inline policies that you can embed with a role, see IAM and AWS STS quotas in the IAM User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-rolepolicy.html

CloudformationResource:

AWS::IAM::RolePolicy

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_iam import mixins as iam_mixins

# policy_document: Any

cfn_role_policy_props_mixin = iam_mixins.CfnRolePolicyPropsMixin(iam_mixins.CfnRolePolicyMixinProps(
    policy_document=policy_document,
    policy_name="policyName",
    role_name="roleName"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::IAM::RolePolicy.

Parameters:
  • props (Union[CfnRolePolicyMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['policyDocument', 'policyName', 'roleName']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

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

Stability:

experimental