Class ForceNewDeployment.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.ForceNewDeployment.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ForceNewDeployment>
Enclosing interface:
ForceNewDeployment

@Stability(Stable) public static final class ForceNewDeployment.Builder extends Object implements software.amazon.jsii.Builder<ForceNewDeployment>
A builder for ForceNewDeployment
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • enabled

      @Stability(Stable) public ForceNewDeployment.Builder enabled(Boolean enabled)
      Parameters:
      enabled - Whether to enable the force-new-deployment mechanism for the service. This parameter is required. Setting this to true enables the mechanism, but on its own it does not force a new deployment on every cdk deploy: CloudFormation only starts a new deployment when it detects a change in the template, and the signal for that is the nonce value changing between deployments. If nonce is not provided or its value stays the same across deployments, no new deployment is forced. When set to false, the ForceNewDeployment property is rendered with EnableForceNewDeployment: false.

      To force a new deployment on every cdk deploy, provide a nonce with a unique, time-varying value such as a timestamp, random string, or sequence number (e.g. Date.now().toString()).

      Returns:
      this
    • nonce

      @Stability(Stable) public ForceNewDeployment.Builder nonce(String nonce)
      Parameters:
      nonce - A unique nonce value that signals Amazon ECS to start a new deployment. When you change this value, it triggers a new deployment even though no other service parameters have changed. Use a stable, time-varying value like a commit hash, image digest, or version string.

      If not provided and enabled is true, only EnableForceNewDeployment is set without a nonce.

      Must be between 1 and 255 characters.

      Returns:
      this
    • build

      @Stability(Stable) public ForceNewDeployment build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<ForceNewDeployment>
      Returns:
      a new instance of ForceNewDeployment
      Throws:
      NullPointerException - if any required attribute was not provided