Class: AWSCDK::SSM::StringParameterAttributes

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

Overview

Attributes for parameters of various types of string.

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter_name:, simple_name: nil, force_dynamic_reference: nil, type: nil, value_type: nil, version: nil) ⇒ StringParameterAttributes

Returns a new instance of StringParameterAttributes.

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.

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

    Use a dynamic reference as the representation in CloudFormation template level.

  • type (AWSCDK::SSM::ParameterType, nil) (defaults to: nil)

    The type of the string parameter.

  • value_type (AWSCDK::SSM::ParameterValueType, nil) (defaults to: nil)

    The type of the string parameter value.

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

    The version number of the value you wish to retrieve.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'ssm/string_parameter_attributes.rb', line 15

def initialize(parameter_name:, simple_name: nil, force_dynamic_reference: nil, type: nil, value_type: 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?
  @force_dynamic_reference = force_dynamic_reference
  Jsii::Type.check_type(@force_dynamic_reference, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "forceDynamicReference") unless @force_dynamic_reference.nil?
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3NtLlBhcmFtZXRlclR5cGUifQ==")), "type") unless @type.nil?
  @value_type = value_type
  Jsii::Type.check_type(@value_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3NtLlBhcmFtZXRlclZhbHVlVHlwZSJ9")), "valueType") unless @value_type.nil?
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "version") unless @version.nil?
end

Instance Attribute Details

#force_dynamic_referenceBoolean? (readonly)

Note:

Default: false

Use a dynamic reference as the representation in CloudFormation template level.

By default, CDK tries to deduce an appropriate representation based on the parameter value (a CfnParameter or a dynamic reference). Use this flag to override the representation when it does not work.

Returns:

  • (Boolean, nil)


61
62
63
# File 'ssm/string_parameter_attributes.rb', line 61

def force_dynamic_reference
  @force_dynamic_reference
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)


36
37
38
# File 'ssm/string_parameter_attributes.rb', line 36

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)


54
55
56
# File 'ssm/string_parameter_attributes.rb', line 54

def simple_name
  @simple_name
end

#typeAWSCDK::SSM::ParameterType? (readonly)

Deprecated.
  • use valueType instead
Note:

Default: ParameterType.STRING

The type of the string parameter.

Returns:



67
68
69
# File 'ssm/string_parameter_attributes.rb', line 67

def type
  @type
end

#value_typeAWSCDK::SSM::ParameterValueType? (readonly)

Note:

Default: ParameterValueType.STRING

The type of the string parameter value.

Using specific types can be helpful in catching invalid values at the start of creating or updating a stack. CloudFormation validates the values against existing values in the account.

Note - if you want to allow values from different AWS accounts, use ParameterValueType.STRING



80
81
82
# File 'ssm/string_parameter_attributes.rb', line 80

def value_type
  @value_type
end

#versionNumeric? (readonly)

Note:

Default: The latest version will be retrieved.

The version number of the value you wish to retrieve.

Returns:

  • (Numeric, nil)


85
86
87
# File 'ssm/string_parameter_attributes.rb', line 85

def version
  @version
end

Class Method Details

.jsii_propertiesObject



87
88
89
90
91
92
93
94
95
96
# File 'ssm/string_parameter_attributes.rb', line 87

def self.jsii_properties
  {
    :parameter_name => "parameterName",
    :simple_name => "simpleName",
    :force_dynamic_reference => "forceDynamicReference",
    :type => "type",
    :value_type => "valueType",
    :version => "version",
  }
end

Instance Method Details

#to_jsiiObject



98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'ssm/string_parameter_attributes.rb', line 98

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "parameterName" => @parameter_name,
    "simpleName" => @simple_name,
    "forceDynamicReference" => @force_dynamic_reference,
    "type" => @type,
    "valueType" => @value_type,
    "version" => @version,
  })
  result.compact
end