EncryptedResources Class
Utility class for discovering and registering encrypted resource traits.
This class provides methods to retrieve IEncryptedResource instances from constructs, enabling automatic KMS key permission grants during IAM grant operations.
Example
ts
// 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 encryptedResources = new iam.EncryptedResources();
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam
encrypted_resources = iam.EncryptedResources()
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;
EncryptedResources encryptedResources = new EncryptedResources();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
var encryptedResources = new EncryptedResources();
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
encryptedResources := awscdk.Aws_iam.NewEncryptedResources()
Initializer
ts
new EncryptedResources()
python
EncryptedResources()
java
new EncryptedResources()
csharp
new EncryptedResources()
go
NewEncryptedResources()
Methods
of(resource: IEnvironmentAware): IEncryptedResource@staticmethod def of(resource: IEnvironmentAware) -> IEncryptedResourcepublic static IEncryptedResource of(IEnvironmentAware resource)public static IEncryptedResource Of(IEnvironmentAware resource)func Of(Resource IEnvironmentAware) IEncryptedResourcestatic#Retrieve the IEncryptedResource associated with a construct, if available.
register(scope: IConstruct, cfnType: string, factory: IEncryptedResourceFactory): void@staticmethod def register(scope: IConstruct, cfn_type: str, factory: IEncryptedResourceFactory) -> Nonepublic static void register(IConstruct scope, String cfnType, IEncryptedResourceFactory factory)public static void Register(IConstruct scope, string cfnType, IEncryptedResourceFactory factory)func Register(Scope IConstruct, CfnType *string, Factory IEncryptedResourceFactory)static#Register a factory for a specific CloudFormation resource type and scope.