Class: AWSCDK::CrossStackReferences

Inherits:
Jsii::Object
  • Object
show all
Defined in:
cross_stack_references.rb

Overview

Ergonomic API for configuring cross-stack reference strength on a construct.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CrossStackReferences

Returns a new instance of CrossStackReferences.

Raises:

  • (NoMethodError)


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_methodsObject



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.

Parameters:

  • scope (Constructs::IConstruct)

    The construct to configure.

Returns:

  • (AWSCDK::CrossStackReferences)


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).

Parameters:



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).

Parameters:



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