Class: AWSCDK::CfnElement
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::CfnElement
- Defined in:
- cfn_element.rb
Overview
An element of a CloudFormation stack.
Direct Known Subclasses
CfnCondition, CfnHook, CfnOutput, CfnParameter, CfnRefElement, AWSCDK::CloudFormationInclude::CfnInclude
Class Method Summary collapse
-
.is_cfn_element(x) ⇒ Boolean
Returns
trueif a construct is a stack element (i.e. part of the synthesized cloudformation template). - .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
- #creation_stack ⇒ Array<String>
-
#initialize(scope, id) ⇒ CfnElement
constructor
Creates an entity and binds it to a tree.
-
#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.
-
#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) ⇒ CfnElement
Creates an entity and binds it to a tree.
Note that the root of the tree must be a Stack object (not just any Root).
14 15 16 17 18 |
# File 'cfn_element.rb', line 14 def initialize(scope, id) 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::Object.instance_method(:initialize).bind(self).call(scope, id) end |
Class Method Details
.is_cfn_element(x) ⇒ Boolean
Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of instanceof to allow stack elements from different
versions of this library to be included in the same stack.
39 40 41 42 |
# File 'cfn_element.rb', line 39 def self.is_cfn_element(x) Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x") Jsii::Kernel.instance.call_static("aws-cdk-lib.CfnElement", "isCfnElement", [x]) end |
.jsii_overridable_methods ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'cfn_element.rb', line 20 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 }, :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 }, } end |
Instance Method Details
#creation_stack ⇒ Array<String>
52 53 54 |
# File 'cfn_element.rb', line 52 def creation_stack() jsii_get_property("creationStack") 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).
64 65 66 |
# File 'cfn_element.rb', line 64 def logical_id() jsii_get_property("logicalId") end |
#node ⇒ Constructs::Node
The tree node.
47 48 49 |
# File 'cfn_element.rb', line 47 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_element.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 |
#stack ⇒ AWSCDK::Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
73 74 75 |
# File 'cfn_element.rb', line 73 def stack() jsii_get_property("stack") end |
#to_string ⇒ String
Returns a string representation of this construct.
80 81 82 |
# File 'cfn_element.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_element.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 |