interface IResourceWithPolicyV2
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.IAM.IResourceWithPolicyV2 |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#IResourceWithPolicyV2 |
Java | software.amazon.awscdk.services.iam.IResourceWithPolicyV2 |
Python | aws_cdk.aws_iam.IResourceWithPolicyV2 |
TypeScript (source) | aws-cdk-lib » aws_iam » IResourceWithPolicyV2 |
Implemented by
Lambda, Rest, Spec, Step, Table, Table, File, Event, Log
A resource with a resource policy that can be added to.
Properties
| Name | Type | Description |
|---|---|---|
| env | Resource | The environment this resource belongs to. |
env
Type:
Resource
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.
Methods
| Name | Description |
|---|---|
| add | Add a statement to the resource's resource policy. |
addToResourcePolicy(statement)
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
Parameters
- statement
PolicyStatement
Returns
Add a statement to the resource's resource policy.

.NET
Go
Java
Python
TypeScript (