Class: AWSCDK::CrossStackReferences
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::CrossStackReferences
- Defined in:
- cross_stack_references.rb
Overview
Ergonomic API for configuring cross-stack reference strength on a construct.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.of(scope) ⇒ AWSCDK::CrossStackReferences
Returns a
CrossStackReferencesconfigurator for the given construct.
Instance Method Summary collapse
-
#consume(strength) ⇒ void
Set the default reference strength used when this scope consumes references from other stacks.
-
#initialize(*args) ⇒ CrossStackReferences
constructor
A new instance of CrossStackReferences.
-
#produce(strength) ⇒ void
Set how this resource is referenced when consumed from another stack.
Constructor Details
#initialize(*args) ⇒ CrossStackReferences
Returns a new instance of CrossStackReferences.
8 9 10 |
# File 'cross_stack_references.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.CrossStackReferences does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 |
# File 'cross_stack_references.rb', line 12 def self.jsii_overridable_methods { :consume => { kind: :method, name: "consume", is_optional: false }, :produce => { kind: :method, name: "produce", is_optional: false }, } end |
.of(scope) ⇒ AWSCDK::CrossStackReferences
Returns a CrossStackReferences configurator for the given construct.
23 24 25 26 |
# File 'cross_stack_references.rb', line 23 def self.of(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope") Jsii::Kernel.instance.call_static("aws-cdk-lib.CrossStackReferences", "of", [scope]) end |
Instance Method Details
#consume(strength) ⇒ void
This method returns an undefined value.
Set the default reference strength used when this scope consumes references from other stacks.
This controls the consuming side: sets the context key that determines how incoming cross-stack references are resolved for this scope and its descendants.
Equivalent to scope.node.setContext(DEFAULT_CROSS_STACK_REFERENCES, strength).
37 38 39 40 |
# File 'cross_stack_references.rb', line 37 def consume(strength) Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength") jsii_call_method("consume", [strength]) end |
#produce(strength) ⇒ void
This method returns an undefined value.
Set how this resource is referenced when consumed from another stack.
This controls the producing side: any cross-stack reference pointing at this resource will use the specified strength instead of the global default.
Equivalent to scope.applyCrossStackReferenceStrength(strength).
51 52 53 54 |
# File 'cross_stack_references.rb', line 51 def produce(strength) Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength") jsii_call_method("produce", [strength]) end |