Class: AWSCDK::CfnCondition

Inherits:
CfnElement
  • Object
show all
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

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.

Parameters:



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_methodsObject



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_stackArray<String>

Returns:

  • (Array<String>)


48
49
50
# File 'cfn_condition.rb', line 48

def creation_stack()
  jsii_get_property("creationStack")
end

#expressionAWSCDK::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_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)


60
61
62
# File 'cfn_condition.rb', line 60

def logical_id()
  jsii_get_property("logicalId")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::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.

Parameters:

  • new_logical_id (String)

    The new logical ID to use for this stack element.



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.

Parameters:

Returns:

  • (Object)


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

#stackAWSCDK::Stack

The stack in which this element is defined.

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

Returns:



69
70
71
# File 'cfn_condition.rb', line 69

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


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