Class CfnCondition

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
ICfnConditionExpression, IConstruct, IDependable, IResolvable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:54.832Z") @Stability(Stable) public class CfnCondition extends CfnElement implements ICfnConditionExpression, IResolvable
Represents a CloudFormation condition, for resources which must be conditionally created and the determination must be made at deploy time.

Example:

 CfnBucket rawBucket = CfnBucket.Builder.create(this, "Bucket").build();
 // -or-
 CfnBucket rawBucketAlt = (CfnBucket)myBucket.getNode().getDefaultChild();
 // then
 rawBucket.getCfnOptions().getCondition() = CfnCondition.Builder.create(this, "EnableBucket").build();
 rawBucket.getCfnOptions().getMetadata() = Map.of(
         "metadataKey", "MetadataValue");
 
  • Constructor Details

    • CfnCondition

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

      protected CfnCondition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnCondition

      @Stability(Stable) public CfnCondition(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnConditionProps props)
      Build a new condition.

      The condition must be constructed with a condition token, that the condition is based on.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • CfnCondition

      @Stability(Stable) public CfnCondition(@NotNull software.constructs.Construct scope, @NotNull String id)
      Build a new condition.

      The condition must be constructed with a condition token, that the condition is based on.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • resolve

      @Stability(Stable) @NotNull public Object resolve(@NotNull IResolveContext _context)
      Synthesizes the condition.

      Specified by:
      resolve in interface IResolvable
      Parameters:
      _context - This parameter is required.
    • getExpression

      @Stability(Stable) @Nullable public ICfnConditionExpression getExpression()
      The condition statement.
    • setExpression

      @Stability(Stable) public void setExpression(@Nullable ICfnConditionExpression value)
      The condition statement.