Class: AWSCDK::CfnMapping

Inherits:
CfnRefElement
  • Object
show all
Defined in:
cfn_mapping.rb

Overview

Represents a CloudFormation mapping.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CfnMapping.

Parameters:



11
12
13
14
15
16
17
# File 'cfn_mapping.rb', line 11

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CfnMappingProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5NYXBwaW5nUHJvcHMifQ==")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'cfn_mapping.rb', line 19

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 },
    :ref => { kind: :property, name: "ref", is_optional: false },
    :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 },
    :find_in_map => { kind: :method, name: "findInMap", is_optional: false },
    :set_value => { kind: :method, name: "setValue", is_optional: false },
  }
end

Instance Method Details

#creation_stackArray<String>

Returns:

  • (Array<String>)


42
43
44
# File 'cfn_mapping.rb', line 42

def creation_stack()
  jsii_get_property("creationStack")
end

#find_in_map(key1, key2, default_value = nil) ⇒ String

Returns A reference to a value in the map based on the two keys. If mapping is lazy, the value from the map or default value is returned instead of the reference and the mapping is not rendered in the template.

Parameters:

  • key1 (String)
  • key2 (String)
  • default_value (String, nil) (defaults to: nil)

Returns:

  • (String)

    A reference to a value in the map based on the two keys. If mapping is lazy, the value from the map or default value is returned instead of the reference and the mapping is not rendered in the template.



113
114
115
116
117
118
# File 'cfn_mapping.rb', line 113

def find_in_map(key1, key2, default_value = nil)
  Jsii::Type.check_type(key1, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key1")
  Jsii::Type.check_type(key2, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key2")
  Jsii::Type.check_type(default_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultValue") unless default_value.nil?
  jsii_call_method("findInMap", [key1, key2, default_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)


54
55
56
# File 'cfn_mapping.rb', line 54

def logical_id()
  jsii_get_property("logicalId")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


37
38
39
# File 'cfn_mapping.rb', line 37

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.



104
105
106
107
# File 'cfn_mapping.rb', line 104

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

#refString

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Returns:

  • (String)


73
74
75
# File 'cfn_mapping.rb', line 73

def ref()
  jsii_get_property("ref")
end

#set_value(key1, key2, value) ⇒ void

This method returns an undefined value.

Sets a value in the map based on the two keys.

Parameters:

  • key1 (String)
  • key2 (String)
  • value (Object)


126
127
128
129
130
131
# File 'cfn_mapping.rb', line 126

def set_value(key1, key2, value)
  Jsii::Type.check_type(key1, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key1")
  Jsii::Type.check_type(key2, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key2")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("setValue", [key1, key2, value])
end

#stackAWSCDK::Stack

The stack in which this element is defined.

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

Returns:



63
64
65
# File 'cfn_mapping.rb', line 63

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


80
81
82
# File 'cfn_mapping.rb', line 80

def to_string()
  jsii_call_method("toString", [])
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)


93
94
95
96
97
98
# File 'cfn_mapping.rb', line 93

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