Class: AWSCDK::CfnParameter

Inherits:
CfnElement
  • Object
show all
Defined in:
cfn_parameter.rb

Overview

A CloudFormation parameter.

Use the optional Parameters section to customize your templates. Parameters enable you to input custom values to your template each time you create or update a stack.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ CfnParameter

Creates a parameter construct.

Note that the name (logical ID) of the parameter will derive from its coname and location within the stack. Therefore, it is recommended that parameters are defined at the stack level.

Parameters:

  • scope (Constructs::Construct)

    The parent construct.

  • id (String)
  • props (AWSCDK::CfnParameterProps, nil) (defaults to: nil)

    The parameter properties.



20
21
22
23
24
25
26
# File 'cfn_parameter.rb', line 20

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CfnParameterProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5QYXJhbWV0ZXJQcm9wcyJ9")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'cfn_parameter.rb', line 28

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :creation_stack => { kind: :property, name: "creationStack", is_optional: false },
    :logical_id => { kind: :property, name: "logicalId", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :value => { kind: :property, name: "value", is_optional: false },
    :value_as_list => { kind: :property, name: "valueAsList", is_optional: false },
    :value_as_number => { kind: :property, name: "valueAsNumber", is_optional: false },
    :value_as_string => { kind: :property, name: "valueAsString", is_optional: false },
    :default => { kind: :property, name: "default", is_optional: false },
    :no_echo => { kind: :property, name: "noEcho", is_optional: false },
    :type => { kind: :property, name: "type", is_optional: false },
    :allowed_pattern => { kind: :property, name: "allowedPattern", is_optional: true },
    :allowed_values => { kind: :property, name: "allowedValues", is_optional: true },
    :constraint_description => { kind: :property, name: "constraintDescription", is_optional: true },
    :description => { kind: :property, name: "description", is_optional: true },
    :max_length => { kind: :property, name: "maxLength", is_optional: true },
    :max_value => { kind: :property, name: "maxValue", is_optional: true },
    :min_length => { kind: :property, name: "minLength", is_optional: true },
    :min_value => { kind: :property, name: "minValue", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :override_logical_id => { kind: :method, name: "overrideLogicalId", is_optional: false },
    :resolve => { kind: :method, name: "resolve", is_optional: false },
  }
end

Instance Method Details

#allowed_patternString?

Note:

Default: - No constraints on patterns allowed for parameter.

A regular expression that represents the patterns to allow for String types.

Returns:

  • (String, nil)


162
163
164
# File 'cfn_parameter.rb', line 162

def allowed_pattern()
  jsii_get_property("allowedPattern")
end

#allowed_pattern=(value) ⇒ Object



166
167
168
169
# File 'cfn_parameter.rb', line 166

def allowed_pattern=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "allowedPattern") unless value.nil?
  jsii_set_property("allowedPattern", value)
end

#allowed_valuesArray<String>?

Note:

Default: - No constraints on values allowed for parameter.

An array containing the list of values allowed for the parameter.

Returns:

  • (Array<String>, nil)


175
176
177
# File 'cfn_parameter.rb', line 175

def allowed_values()
  jsii_get_property("allowedValues")
end

#allowed_values=(value) ⇒ Object



179
180
181
182
# File 'cfn_parameter.rb', line 179

def allowed_values=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedValues") unless value.nil?
  jsii_set_property("allowedValues", value)
end

#constraint_descriptionString?

Note:

Default: - No description with customized error message when user specifies invalid values.

A string that explains a constraint when the constraint is violated.

For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+ displays the following error message when the user specifies an invalid value:

Returns:

  • (String, nil)


192
193
194
# File 'cfn_parameter.rb', line 192

def constraint_description()
  jsii_get_property("constraintDescription")
end

#constraint_description=(value) ⇒ Object



196
197
198
199
# File 'cfn_parameter.rb', line 196

def constraint_description=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constraintDescription") unless value.nil?
  jsii_set_property("constraintDescription", value)
end

#creation_stackArray<String>

Returns:

  • (Array<String>)


64
65
66
# File 'cfn_parameter.rb', line 64

def creation_stack()
  jsii_get_property("creationStack")
end

#defaultObject

Note:

Default: - No default value for parameter.

A value of the appropriate type for the template to use if no value is specified when a stack is created.

If you define constraints for the parameter, you must specify a value that adheres to those constraints.

Returns:

  • (Object)


124
125
126
# File 'cfn_parameter.rb', line 124

def default()
  jsii_get_property("default")
end

#default=(value) ⇒ Object



128
129
130
131
# File 'cfn_parameter.rb', line 128

def default=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "default")
  jsii_set_property("default", value)
end

#descriptionString?

Note:

Default: - No description for the parameter.

A string of up to 4000 characters that describes the parameter.

Returns:

  • (String, nil)


205
206
207
# File 'cfn_parameter.rb', line 205

def description()
  jsii_get_property("description")
end

#description=(value) ⇒ Object



209
210
211
212
# File 'cfn_parameter.rb', line 209

def description=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless value.nil?
  jsii_set_property("description", value)
end

#logical_idString

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use override_logical_id(new_logical_id).

Returns:

  • (String)


76
77
78
# File 'cfn_parameter.rb', line 76

def logical_id()
  jsii_get_property("logicalId")
end

#max_lengthNumeric?

Note:

Default: - None.

An integer value that determines the largest number of characters you want to allow for String types.

Returns:

  • (Numeric, nil)


218
219
220
# File 'cfn_parameter.rb', line 218

def max_length()
  jsii_get_property("maxLength")
end

#max_length=(value) ⇒ Object



222
223
224
225
# File 'cfn_parameter.rb', line 222

def max_length=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxLength") unless value.nil?
  jsii_set_property("maxLength", value)
end

#max_valueNumeric?

Note:

Default: - None.

A numeric value that determines the largest numeric value you want to allow for Number types.

Returns:

  • (Numeric, nil)


231
232
233
# File 'cfn_parameter.rb', line 231

def max_value()
  jsii_get_property("maxValue")
end

#max_value=(value) ⇒ Object



235
236
237
238
# File 'cfn_parameter.rb', line 235

def max_value=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxValue") unless value.nil?
  jsii_set_property("maxValue", value)
end

#min_lengthNumeric?

Note:

Default: - None.

An integer value that determines the smallest number of characters you want to allow for String types.

Returns:

  • (Numeric, nil)


244
245
246
# File 'cfn_parameter.rb', line 244

def min_length()
  jsii_get_property("minLength")
end

#min_length=(value) ⇒ Object



248
249
250
251
# File 'cfn_parameter.rb', line 248

def min_length=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minLength") unless value.nil?
  jsii_set_property("minLength", value)
end

#min_valueNumeric?

Note:

Default: - None.

A numeric value that determines the smallest numeric value you want to allow for Number types.

Returns:

  • (Numeric, nil)


257
258
259
# File 'cfn_parameter.rb', line 257

def min_value()
  jsii_get_property("minValue")
end

#min_value=(value) ⇒ Object



261
262
263
264
# File 'cfn_parameter.rb', line 261

def min_value=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minValue") unless value.nil?
  jsii_set_property("minValue", value)
end

#no_echoBoolean

Indicates if this parameter is configured with "NoEcho" enabled.

Returns:

  • (Boolean)


136
137
138
# File 'cfn_parameter.rb', line 136

def no_echo()
  jsii_get_property("noEcho")
end

#no_echo=(value) ⇒ Object



140
141
142
143
# File 'cfn_parameter.rb', line 140

def no_echo=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "noEcho")
  jsii_set_property("noEcho", value)
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


59
60
61
# File 'cfn_parameter.rb', line 59

def node()
  jsii_get_property("node")
end

#override_logical_id(new_logical_id) ⇒ void

This method returns an undefined value.

Overrides the auto-generated logical ID with a specific ID.

Parameters:

  • new_logical_id (String)

    The new logical ID to use for this stack element.



293
294
295
296
# File 'cfn_parameter.rb', line 293

def override_logical_id(new_logical_id)
  Jsii::Type.check_type(new_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newLogicalId")
  jsii_call_method("overrideLogicalId", [new_logical_id])
end

#resolve(_context) ⇒ Object

Parameters:

Returns:

  • (Object)


300
301
302
303
# File 'cfn_parameter.rb', line 300

def resolve(_context)
  Jsii::Type.check_type(_context, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUmVzb2x2ZUNvbnRleHQifQ==")), "_context")
  jsii_call_method("resolve", [_context])
end

#stackAWSCDK::Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Returns:



85
86
87
# File 'cfn_parameter.rb', line 85

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


269
270
271
# File 'cfn_parameter.rb', line 269

def to_string()
  jsii_call_method("toString", [])
end

#typeString

Note:

Default: String

The data type for the parameter (DataType).

Returns:

  • (String)


149
150
151
# File 'cfn_parameter.rb', line 149

def type()
  jsii_get_property("type")
end

#type=(value) ⇒ Object



153
154
155
156
# File 'cfn_parameter.rb', line 153

def type=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  jsii_set_property("type", value)
end

#valueAWSCDK::IResolvable

The parameter value as a Token.

Returns:



92
93
94
# File 'cfn_parameter.rb', line 92

def value()
  jsii_get_property("value")
end

#value_as_listArray<String>

The parameter value, if it represents a string list.

Returns:

  • (Array<String>)


99
100
101
# File 'cfn_parameter.rb', line 99

def value_as_list()
  jsii_get_property("valueAsList")
end

#value_as_numberNumeric

The parameter value, if it represents a number.

Returns:

  • (Numeric)


106
107
108
# File 'cfn_parameter.rb', line 106

def value_as_number()
  jsii_get_property("valueAsNumber")
end

#value_as_stringString

The parameter value, if it represents a string.

Returns:

  • (String)


113
114
115
# File 'cfn_parameter.rb', line 113

def value_as_string()
  jsii_get_property("valueAsString")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


282
283
284
285
286
287
# File 'cfn_parameter.rb', line 282

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end