Module: AWSCDK::IAM::IEncryptedResource

Includes:
AWSCDK::Interfaces::IEnvironmentAware
Included in:
DynamoDB::TableBase, S3::BucketBase, SNS::TopicBase, SQS::QueueBase, SSM::StringListParameter, SSM::StringParameter
Defined in:
iam/i_encrypted_resource.rb

Overview

A resource that contains data that can be encrypted, using a KMS key.s.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



36
37
38
39
40
41
# File 'iam/i_encrypted_resource.rb', line 36

def self.jsii_overridable_methods
  {
    :env => { kind: :property, name: "env", is_optional: false },
    :grant_on_key => { kind: :method, name: "grantOnKey", is_optional: false },
  }
end

Instance Method Details

#envAWSCDK::Interfaces::ResourceEnvironment

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.



19
20
21
# File 'iam/i_encrypted_resource.rb', line 19

def env()
  jsii_get_property("env")
end

#grant_on_key(grantee, *actions) ⇒ AWSCDK::IAM::GrantOnKeyResult

Gives permissions to a grantable entity to perform actions on the encryption key.

Parameters:

Returns:



28
29
30
31
32
33
34
# File 'iam/i_encrypted_resource.rb', line 28

def grant_on_key(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grantOnKey", [grantee, *actions])
end