Class: AWSCDK::CfnMapping
- Inherits:
-
CfnRefElement
- Object
- CfnRefElement
- AWSCDK::CfnMapping
- Defined in:
- cfn_mapping.rb
Overview
Represents a CloudFormation mapping.
Class Method Summary collapse
Instance Method Summary collapse
- #creation_stack ⇒ Array<String>
-
#find_in_map(key1, key2, default_value = nil) ⇒ String
A reference to a value in the map based on the two keys.
-
#initialize(scope, id, props = nil) ⇒ CfnMapping
constructor
A new instance of CfnMapping.
-
#logical_id ⇒ String
The logical ID for this CloudFormation stack element.
-
#node ⇒ Constructs::Node
The tree node.
-
#override_logical_id(new_logical_id) ⇒ void
Overrides the auto-generated logical ID with a specific ID.
-
#ref ⇒ String
Return a string that will be resolved to a CloudFormation
{ Ref }for this element. -
#set_value(key1, key2, value) ⇒ void
Sets a value in the map based on the two keys.
-
#stack ⇒ AWSCDK::Stack
The stack in which this element is defined.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ CfnMapping
Returns a new instance of CfnMapping.
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_methods ⇒ Object
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_stack ⇒ 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.
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_id ⇒ String
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).
54 55 56 |
# File 'cfn_mapping.rb', line 54 def logical_id() jsii_get_property("logicalId") end |
#node ⇒ Constructs::Node
The tree 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.
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 |
#ref ⇒ String
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 }).
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.
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 |
#stack ⇒ AWSCDK::Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
63 64 65 |
# File 'cfn_mapping.rb', line 63 def stack() jsii_get_property("stack") end |
#to_string ⇒ String
Returns a string representation of this construct.
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.
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 |