Class: AWSCDK::KMS::AliasProps

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

Overview

Construction properties for a KMS Key Alias object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alias_name:, target_key:, removal_policy: nil) ⇒ AliasProps

Returns a new instance of AliasProps.

Parameters:

  • alias_name (String)

    The name of the alias.

  • target_key (AWSCDK::KMS::IKey)

    The ID of the key for which you are creating the alias.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    Policy to apply when the alias is removed from this stack.



10
11
12
13
14
15
16
17
# File 'kms/alias_props.rb', line 10

def initialize(alias_name:, target_key:, removal_policy: nil)
  @alias_name = alias_name
  Jsii::Type.check_type(@alias_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "aliasName")
  @target_key = target_key
  Jsii::Type.check_type(@target_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "targetKey")
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
end

Instance Attribute Details

#alias_nameString (readonly)

The name of the alias.

The name must start with alias followed by a forward slash, such as alias/. You can't specify aliases that begin with alias/AWS. These aliases are reserved.

Returns:

  • (String)


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

def alias_name
  @alias_name
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: - The alias will be deleted

Policy to apply when the alias is removed from this stack.

Returns:



39
40
41
# File 'kms/alias_props.rb', line 39

def removal_policy
  @removal_policy
end

#target_keyAWSCDK::KMS::IKey (readonly)

The ID of the key for which you are creating the alias.

Specify the key's globally unique identifier or Amazon Resource Name (ARN). You can't specify another alias.

Returns:



34
35
36
# File 'kms/alias_props.rb', line 34

def target_key
  @target_key
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'kms/alias_props.rb', line 41

def self.jsii_properties
  {
    :alias_name => "aliasName",
    :target_key => "targetKey",
    :removal_policy => "removalPolicy",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'kms/alias_props.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "aliasName" => @alias_name,
    "targetKey" => @target_key,
    "removalPolicy" => @removal_policy,
  })
  result.compact
end