# CrossStackReferences

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

- Source: [`core/lib/cross-stack-reference-strength.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/cross-stack-reference-strength.ts#L45)
- Type last changed: v2.258.0 · 4 Jun 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const crossStackReferences = cdk.CrossStackReferences.of(this);
```

## Methods

- `consume(strength: ReferenceStrength): void` — 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.

- `of(scope: IConstruct): CrossStackReferences // chainable` (static) — Returns a `CrossStackReferences` configurator for the given construct.

  **Parameters**

  - `scope` — The construct to configure.

- `produce(strength: ReferenceStrength): void` — 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.
