Class CrossStackReferences

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.CrossStackReferences
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)", date="2026-06-04T12:52:05.071Z") @Stability(Stable) public class CrossStackReferences extends software.amazon.jsii.JsiiObject
Ergonomic API for configuring cross-stack reference strength on a construct.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 CrossStackReferences crossStackReferences = CrossStackReferences.of(this);
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CrossStackReferences(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    CrossStackReferences(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Set the default reference strength used when this scope consumes references from other stacks.
    of(software.constructs.IConstruct scope)
    Returns a CrossStackReferences configurator for the given construct.
    void
    Set how this resource is referenced when consumed from another stack.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • CrossStackReferences

      protected CrossStackReferences(software.amazon.jsii.JsiiObjectRef objRef)
    • CrossStackReferences

      protected CrossStackReferences(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • of

      @Stability(Stable) @NotNull public static CrossStackReferences of(@NotNull software.constructs.IConstruct scope)
      Returns a CrossStackReferences configurator for the given construct.

      Parameters:
      scope - The construct to configure. This parameter is required.
    • consume

      @Stability(Stable) public void consume(@NotNull ReferenceStrength strength)
      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:
      strength -
      • The reference strength to use.
      This parameter is required.
    • produce

      @Stability(Stable) public void produce(@NotNull ReferenceStrength strength)
      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:
      strength -
      • The reference strength to use.
      This parameter is required.