Class: AWSCDK::CfnOutput

Inherits:
CfnElement
  • Object
show all
Defined in:
cfn_output.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ CfnOutput

Creates a CfnOutput value for this stack.

Parameters:

  • scope (Constructs::Construct)

    The parent construct.

  • id (String)
  • props (AWSCDK::CfnOutputProps)

    CfnOutput properties.



12
13
14
15
16
17
18
# File 'cfn_output.rb', line 12

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

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'cfn_output.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 },
    :import_value => { kind: :property, name: "importValue", is_optional: false },
    :value => { kind: :property, name: "value", is_optional: false },
    :condition => { kind: :property, name: "condition", is_optional: true },
    :description => { kind: :property, name: "description", is_optional: true },
    :export_name => { kind: :property, name: "exportName", 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 },
  }
end

Instance Method Details

#conditionAWSCDK::CfnCondition?

Note:

Default: - No condition is associated with the output.

A condition to associate with this output value.

If the condition evaluates to false, this output value will not be included in the stack.

Returns:



112
113
114
# File 'cfn_output.rb', line 112

def condition()
  jsii_get_property("condition")
end

#condition=(value) ⇒ Object



116
117
118
119
# File 'cfn_output.rb', line 116

def condition=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5Db25kaXRpb24ifQ==")), "condition") unless value.nil?
  jsii_set_property("condition", value)
end

#creation_stackArray<String>

Returns:

  • (Array<String>)


45
46
47
# File 'cfn_output.rb', line 45

def creation_stack()
  jsii_get_property("creationStack")
end

#descriptionString?

Note:

Default: - No description.

A String type that describes the output value.

The description can be a maximum of 4 K in length.

Returns:

  • (String, nil)


127
128
129
# File 'cfn_output.rb', line 127

def description()
  jsii_get_property("description")
end

#description=(value) ⇒ Object



131
132
133
134
# File 'cfn_output.rb', line 131

def description=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless value.nil?
  jsii_set_property("description", value)
end

#export_nameString?

Note:

Default: - the output is not exported

The name used to export the value of this output across stacks.

To use the value in another stack, pass the value of output.importValue to it.

Returns:

  • (String, nil)


143
144
145
# File 'cfn_output.rb', line 143

def export_name()
  jsii_get_property("exportName")
end

#export_name=(value) ⇒ Object



147
148
149
150
# File 'cfn_output.rb', line 147

def export_name=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "exportName") unless value.nil?
  jsii_set_property("exportName", value)
end

#import_valueString

Return the Fn.importValue expression to import this value into another stack.

The returned value should not be used in the same stack, but in a different one. It must be deployed to the same environment, as CloudFormation exports can only be imported in the same Region and account.

The is no automatic registration of dependencies between stacks when using this mechanism, so you should make sure to deploy them in the right order yourself.

You can use this mechanism to share values across Stacks in different Stages. If you intend to share the value to another Stack inside the same Stage, the automatic cross-stack referencing mechanism is more convenient.

Returns:

  • (String)


86
87
88
# File 'cfn_output.rb', line 86

def import_value()
  jsii_get_property("importValue")
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)


57
58
59
# File 'cfn_output.rb', line 57

def logical_id()
  jsii_get_property("logicalId")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


40
41
42
# File 'cfn_output.rb', line 40

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.



179
180
181
182
# File 'cfn_output.rb', line 179

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

#stackAWSCDK::Stack

The stack in which this element is defined.

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

Returns:



66
67
68
# File 'cfn_output.rb', line 66

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


155
156
157
# File 'cfn_output.rb', line 155

def to_string()
  jsii_call_method("toString", [])
end

#valueObject

The value of the property returned by the aws cloudformation describe-stacks command.

The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.

Returns:

  • (Object)


96
97
98
# File 'cfn_output.rb', line 96

def value()
  jsii_get_property("value")
end

#value=(value) ⇒ Object



100
101
102
103
# File 'cfn_output.rb', line 100

def value=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_set_property("value", value)
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)


168
169
170
171
172
173
# File 'cfn_output.rb', line 168

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