Interface CfnUpdatePolicy
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnUpdatePolicy.Jsii$Proxy
AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
CfnUpdatePolicy cfnUpdatePolicy = CfnUpdatePolicy.builder()
.autoScalingInstanceRefresh(CfnAutoScalingInstanceRefresh.builder()
.strategy("strategy")
// the properties below are optional
.preferences(CfnAutoScalingInstanceRefreshPreferences.builder()
.alarmSpecification(CfnAutoScalingInstanceRefreshAlarmSpecification.builder()
.alarms(List.of("alarms"))
.build())
.bakeTime(123)
.checkpointDelay(123)
.checkpointPercentages(List.of(123))
.instanceWarmup(123)
.maxHealthyPercentage(123)
.minHealthyPercentage(123)
.scaleInProtectedInstances("scaleInProtectedInstances")
.skipMatching(false)
.standbyInstances("standbyInstances")
.build())
.build())
.autoScalingReplacingUpdate(CfnAutoScalingReplacingUpdate.builder()
.willReplace(false)
.build())
.autoScalingRollingUpdate(CfnAutoScalingRollingUpdate.builder()
.maxBatchSize(123)
.minActiveInstancesPercent(123)
.minInstancesInService(123)
.minSuccessfulInstancesPercent(123)
.pauseTime("pauseTime")
.suspendProcesses(List.of("suspendProcesses"))
.waitOnResourceSignals(false)
.build())
.autoScalingScheduledAction(CfnAutoScalingScheduledAction.builder()
.ignoreUnmodifiedGroupSizeProperties(false)
.build())
.codeDeployLambdaAliasUpdate(CfnCodeDeployLambdaAliasUpdate.builder()
.applicationName("applicationName")
.deploymentGroupName("deploymentGroupName")
// the properties below are optional
.afterAllowTrafficHook("afterAllowTrafficHook")
.beforeAllowTrafficHook("beforeAllowTrafficHook")
.build())
.enableVersionUpgrade(false)
.useOnlineResharding(false)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnUpdatePolicystatic final classAn implementation forCfnUpdatePolicy -
Method Summary
Modifier and TypeMethodDescriptionstatic CfnUpdatePolicy.Builderbuilder()default CfnAutoScalingInstanceRefreshTo specify how AWS CloudFormation handles instance refresh for an Auto Scaling group, use the AutoScalingInstanceRefresh policy.default CfnAutoScalingReplacingUpdateSpecifies whether an Auto Scaling group and the instances it contains are replaced during an update.default CfnAutoScalingRollingUpdateTo specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.default CfnAutoScalingScheduledActionTo specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction policy.default CfnCodeDeployLambdaAliasUpdateTo perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.default BooleanTo upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.default BooleanTo modify a replication group's shards by adding or removing shards, rather than replacing the entire AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAutoScalingInstanceRefresh
To specify how AWS CloudFormation handles instance refresh for an Auto Scaling group, use the AutoScalingInstanceRefresh policy.This policy triggers an instance refresh when certain properties of the Auto Scaling group change (such as launch template or mixed instances policy), replacing instances gradually while maintaining availability.
-
getAutoScalingReplacingUpdate
Specifies whether an Auto Scaling group and the instances it contains are replaced during an update.During replacement, AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation can roll back to the old Auto Scaling group and delete the new Auto Scaling group.
-
getAutoScalingRollingUpdate
To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling group in batches or all at once.
-
getAutoScalingScheduledAction
To specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction policy. -
getCodeDeployLambdaAliasUpdate
@Stability(Stable) @Nullable default CfnCodeDeployLambdaAliasUpdate getCodeDeployLambdaAliasUpdate()To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy. -
getEnableVersionUpgrade
To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy. -
getUseOnlineResharding
To modify a replication group's shards by adding or removing shards, rather than replacing the entire AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy. -
builder
- Returns:
- a
CfnUpdatePolicy.BuilderofCfnUpdatePolicy
-