Module: AWSCDK::IAM::IEncryptedResourceFactory
- Defined in:
- iam/i_encrypted_resource_factory.rb
Overview
Factory interface for creating IEncryptedResource instances from constructs.
Implementations of this interface are registered in the DefaultEncryptedResourceFactories registry and enable automatic KMS key permission grants for encrypted CloudFormation resources. When a grant operation is performed on an encrypted resource, the factory converts L1 constructs into resources that can grant permissions on their associated KMS encryption keys.
Factories are typically registered during static initialization and associated with specific CloudFormation resource types (e.g., 'AWS::DynamoDB::Table'). The CDK's grant system uses these factories to automatically add necessary KMS key permissions when granting access to encrypted resources.
Class Method Summary collapse
Instance Method Summary collapse
-
#for_resource(resource) ⇒ AWSCDK::IAM::IEncryptedResource
Create an IEncryptedResource from a construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 |
# File 'iam/i_encrypted_resource_factory.rb', line 26 def self.jsii_overridable_methods { :for_resource => { kind: :method, name: "forResource", is_optional: false }, } end |
Instance Method Details
#for_resource(resource) ⇒ AWSCDK::IAM::IEncryptedResource
Create an IEncryptedResource from a construct.
21 22 23 24 |
# File 'iam/i_encrypted_resource_factory.rb', line 21 def for_resource(resource) Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "resource") jsii_call_method("forResource", [resource]) end |