class ResourceWithPolicies
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.IAM.ResourceWithPolicies |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#ResourceWithPolicies |
Java | software.amazon.awscdk.services.iam.ResourceWithPolicies |
Python | aws_cdk.aws_iam.ResourceWithPolicies |
TypeScript (source) | aws-cdk-lib » aws_iam » ResourceWithPolicies |
Utility class for discovering and managing resource policy traits.
This class provides methods to retrieve IResourceWithPolicyV2 instances from constructs, enabling resource-based policy management during IAM grant operations.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
const resourceWithPolicies = new iam.ResourceWithPolicies();
Initializer
new ResourceWithPolicies()
Methods
| Name | Description |
|---|---|
| static of(resource) | Retrieve the IResourceWithPolicyV2 associated with a construct, if available. |
| static register(scope, cfnType, factory) | Register a factory for a specific CloudFormation resource type and scope. |
static of(resource)
public static of(resource: IEnvironmentAware): IResourceWithPolicyV2
Parameters
- resource
IEnvironmentAware
Returns
Retrieve the IResourceWithPolicyV2 associated with a construct, if available.
static register(scope, cfnType, factory)
public static register(scope: IConstruct, cfnType: string, factory: IResourcePolicyFactory): void
Parameters
- scope
IConstruct - cfnType
string - factory
IResourcePolicy Factory
Register a factory for a specific CloudFormation resource type and scope.

.NET
Go
Java
Python
TypeScript (