Package software.amazon.awscdk
Enum ReferenceStrength
- All Implemented Interfaces:
Serializable,Comparable<ReferenceStrength>,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)",
date="2026-06-04T12:52:05.170Z")
@Stability(Stable)
public enum ReferenceStrength
extends Enum<ReferenceStrength>
Controls how cross-stack references to a resource are resolved.
Example:
Bucket bucket;
Stack consumer;
CfnOutput.Builder.create(consumer, "BucketArn")
.value(Stack.consumeReference(bucket.getBucketArn(), ReferenceStrength.WEAK))
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBoth strong and weak mechanisms are created (transitional state).Strong reference: uses CloudFormation Export/Import (same region) or ExportWriter/ExportReader custom resources (cross-region).Weak reference: uses Fn::GetStackOutput to read an output directly from the producing stack. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReferenceStrengthReturns the enum constant of this type with the specified name.static ReferenceStrength[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
STRONG
Strong reference: uses CloudFormation Export/Import (same region) or ExportWriter/ExportReader custom resources (cross-region).The producing stack cannot be deleted while consumers exist.
-
WEAK
Weak reference: uses Fn::GetStackOutput to read an output directly from the producing stack.The producing stack or resource can be deleted independently of consumers. This will cause infrastructure in consuming stacks to temporarily reference a nonexistant resource until the consumers are updated as well, causing any accesses in that time frame to fail.
Strong references prevent this.
-
BOTH
Both strong and weak mechanisms are created (transitional state).Use this when migrating from strong to weak. The producer keeps the strong-side artifacts and also adds a plain Output. The consumer switches to Fn::GetStackOutput.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-