CrossStackReferences

class aws_cdk.CrossStackReferences(*args: Any, **kwargs)

Bases: object

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

cross_stack_references = cdk.CrossStackReferences.of(self)

Methods

consume(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 (ReferenceStrength) –

  • The reference strength to use.

Return type:

None

produce(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 (ReferenceStrength) –

  • The reference strength to use.

Return type:

None

Static Methods

classmethod of(scope)

Returns a CrossStackReferences configurator for the given construct.

Parameters:

scope (IConstruct) – The construct to configure.

Return type:

CrossStackReferences