IResourceWithPolicyV2
- class aws_cdk.aws_iam.IResourceWithPolicyV2(*args, **kwargs)
Bases:
IEnvironmentAware,ProtocolA resource with a resource policy that can be added to.
Methods
- add_to_resource_policy(statement)
Add a statement to the resource’s resource policy.
- Parameters:
statement (
PolicyStatement)- Return type:
Attributes
- env
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by creating new class instances like
new Role(),new Bucket(), etc.), this is always the same as the environment of the stack they belong to.For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(),Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.