Class: AWSCDK::CfnCondition
- Inherits:
-
CfnElement
- Object
- CfnElement
- AWSCDK::CfnCondition
- Includes:
- ICfnConditionExpression, IResolvable
- Defined in:
- cfn_condition.rb
Overview
Represents a CloudFormation condition, for resources which must be conditionally created and the determination must be made at deploy time.
Class Method Summary collapse
Instance Method Summary collapse
- #creation_stack ⇒ Array<String>
-
#expression ⇒ AWSCDK::ICfnConditionExpression?
The condition statement.
- #expression=(value) ⇒ Object
-
#initialize(scope, id, props = nil) ⇒ CfnCondition
constructor
Build a new condition.
-
#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.
-
#resolve(_context) ⇒ Object
Synthesizes the condition.
-
#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) ⇒ CfnCondition
Build a new condition.
The condition must be constructed with a condition token, that the condition is based on.
18 19 20 21 22 23 24 |
# File 'cfn_condition.rb', line 18 def initialize(scope, id, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CfnConditionProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5Db25kaXRpb25Qcm9wcyJ9")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'cfn_condition.rb', line 26 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 }, :expression => { kind: :property, name: "expression", 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
#creation_stack ⇒ Array<String>
48 49 50 |
# File 'cfn_condition.rb', line 48 def creation_stack() jsii_get_property("creationStack") end |
#expression ⇒ AWSCDK::ICfnConditionExpression?
The condition statement.
76 77 78 |
# File 'cfn_condition.rb', line 76 def expression() jsii_get_property("expression") end |
#expression=(value) ⇒ Object
80 81 82 83 |
# File 'cfn_condition.rb', line 80 def expression=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ2ZuQ29uZGl0aW9uRXhwcmVzc2lvbiJ9")), "expression") unless value.nil? jsii_set_property("expression", 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).
60 61 62 |
# File 'cfn_condition.rb', line 60 def logical_id() jsii_get_property("logicalId") end |
#node ⇒ Constructs::Node
The tree node.
43 44 45 |
# File 'cfn_condition.rb', line 43 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.
112 113 114 115 |
# File 'cfn_condition.rb', line 112 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
Synthesizes the condition.
121 122 123 124 |
# File 'cfn_condition.rb', line 121 def resolve(_context) Jsii::Type.check_type(_context, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUmVzb2x2ZUNvbnRleHQifQ==")), "_context") jsii_call_method("resolve", [_context]) end |
#stack ⇒ AWSCDK::Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
69 70 71 |
# File 'cfn_condition.rb', line 69 def stack() jsii_get_property("stack") end |
#to_string ⇒ String
Returns a string representation of this construct.
88 89 90 |
# File 'cfn_condition.rb', line 88 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.
101 102 103 104 105 106 |
# File 'cfn_condition.rb', line 101 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 |