Interface ForceNewDeployment
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ForceNewDeployment.Jsii$Proxy
Example:
Cluster cluster;
TaskDefinition taskDefinition;
// Force a new deployment on every `cdk deploy` by using a time-based nonce
FargateService service = FargateService.Builder.create(this, "Service")
.cluster(cluster)
.taskDefinition(taskDefinition)
.forceNewDeployment(ForceNewDeployment.builder()
.enabled(true)
.nonce(Date.now().toString())
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forForceNewDeploymentstatic final classAn implementation forForceNewDeployment -
Method Summary
Modifier and TypeMethodDescriptionstatic ForceNewDeployment.Builderbuilder()Whether to enable the force-new-deployment mechanism for the service.default StringgetNonce()A unique nonce value that signals Amazon ECS to start a new deployment.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getEnabled
Whether to enable the force-new-deployment mechanism for the service.Setting this to
trueenables the mechanism, but on its own it does not force a new deployment on everycdk deploy: CloudFormation only starts a new deployment when it detects a change in the template, and the signal for that is thenoncevalue changing between deployments. Ifnonceis not provided or its value stays the same across deployments, no new deployment is forced. When set tofalse, theForceNewDeploymentproperty is rendered withEnableForceNewDeployment: false.To force a new deployment on every
cdk deploy, provide anoncewith a unique, time-varying value such as a timestamp, random string, or sequence number (e.g.Date.now().toString()).- See Also:
-
getNonce
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
enabledistrue, onlyEnableForceNewDeploymentis set without a nonce.Must be between 1 and 255 characters.
Default: - no nonce
-
builder
- Returns:
- a
ForceNewDeployment.BuilderofForceNewDeployment
-