Class: AWSCDK::SSM::SecureStringParameterAttributes

Inherits:
CommonStringParameterAttributes
  • Object
show all
Defined in:
ssm/secure_string_parameter_attributes.rb

Overview

Attributes for secure string parameters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter_name:, simple_name: nil, encryption_key: nil, version: nil) ⇒ SecureStringParameterAttributes

Returns a new instance of SecureStringParameterAttributes.

Parameters:

  • parameter_name (String)

    The name of the parameter store value.

  • simple_name (Boolean, nil) (defaults to: nil)

    Indicates whether the parameter name is a simple name.

  • encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The encryption key that is used to encrypt this parameter.

  • version (Numeric, nil) (defaults to: nil)

    The version number of the value you wish to retrieve.



11
12
13
14
15
16
17
18
19
20
# File 'ssm/secure_string_parameter_attributes.rb', line 11

def initialize(parameter_name:, simple_name: nil, encryption_key: nil, version: nil)
  @parameter_name = parameter_name
  Jsii::Type.check_type(@parameter_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parameterName")
  @simple_name = simple_name
  Jsii::Type.check_type(@simple_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "simpleName") unless @simple_name.nil?
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil?
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "version") unless @version.nil?
end

Instance Attribute Details

#encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - default master key

The encryption key that is used to encrypt this parameter.

Returns:



51
52
53
# File 'ssm/secure_string_parameter_attributes.rb', line 51

def encryption_key
  @encryption_key
end

#parameter_nameString (readonly)

The name of the parameter store value.

This value can be a token or a concrete string. If it is a concrete string and includes "/" it must also be prefixed with a "/" (fully-qualified).

Returns:

  • (String)


28
29
30
# File 'ssm/secure_string_parameter_attributes.rb', line 28

def parameter_name
  @parameter_name
end

#simple_nameBoolean? (readonly)

Note:

Default: - auto-detect based on parameterName

Indicates whether the parameter name is a simple name.

A parameter name without any "/" is considered a simple name. If the parameter name includes "/", setting simpleName to true might cause unintended issues such as duplicate "/" in the resulting ARN.

This is required only if parameter_name is a token, which means we are unable to detect if the name is simple or "path-like" for the purpose of rendering SSM parameter ARNs.

If parameter_name is not specified, simple_name must be true (or undefined) since the name generated by AWS CloudFormation is always a simple name.

Returns:

  • (Boolean, nil)


46
47
48
# File 'ssm/secure_string_parameter_attributes.rb', line 46

def simple_name
  @simple_name
end

#versionNumeric? (readonly)

Note:

Default: - AWS CloudFormation uses the latest version of the parameter

The version number of the value you wish to retrieve.

Returns:

  • (Numeric, nil)


56
57
58
# File 'ssm/secure_string_parameter_attributes.rb', line 56

def version
  @version
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
# File 'ssm/secure_string_parameter_attributes.rb', line 58

def self.jsii_properties
  {
    :parameter_name => "parameterName",
    :simple_name => "simpleName",
    :encryption_key => "encryptionKey",
    :version => "version",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
77
# File 'ssm/secure_string_parameter_attributes.rb', line 67

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "parameterName" => @parameter_name,
    "simpleName" => @simple_name,
    "encryptionKey" => @encryption_key,
    "version" => @version,
  })
  result.compact
end