Class: AWSCDK::KMS::CfnAliasProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
kms/cfn_alias_props.rb

Overview

Properties for defining a CfnAlias.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alias_name:, target_key_id:) ⇒ CfnAliasProps

Returns a new instance of CfnAliasProps.

Parameters:



11
12
13
14
15
16
# File 'kms/cfn_alias_props.rb', line 11

def initialize(alias_name:, target_key_id:)
  @alias_name = alias_name
  Jsii::Type.check_type(@alias_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "aliasName")
  @target_key_id = target_key_id
  Jsii::Type.check_type(@target_key_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19rbXMuSUtleVJlZiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuaW50ZXJmYWNlcy5hd3Nfa21zLklSZXBsaWNhS2V5UmVmIn1dfX0=")), "targetKeyId")
end

Instance Attribute Details

#alias_nameString (readonly)

Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias .

If you change the value of the AliasName property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC).

The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin with alias/aws/ . The alias/aws/ prefix is reserved for AWS managed keys .



26
27
28
# File 'kms/cfn_alias_props.rb', line 26

def alias_name
  @alias_name
end

#target_key_idString, ... (readonly)

Associates the alias with the specified customer managed key . The KMS key must be in the same AWS account and Region.

A valid key ID is required. If you supply a null or empty string value, this operation returns an error.

For help finding the key ID and ARN, see Finding the key ID and ARN in the AWS Key Management Service Developer Guide .

Specify the key ID or the key ARN of the KMS key.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey .



44
45
46
# File 'kms/cfn_alias_props.rb', line 44

def target_key_id
  @target_key_id
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
# File 'kms/cfn_alias_props.rb', line 46

def self.jsii_properties
  {
    :alias_name => "aliasName",
    :target_key_id => "targetKeyId",
  }
end

Instance Method Details

#to_jsiiObject



53
54
55
56
57
58
59
60
# File 'kms/cfn_alias_props.rb', line 53

def to_jsii
  result = {}
  result.merge!({
    "aliasName" => @alias_name,
    "targetKeyId" => @target_key_id,
  })
  result.compact
end