aws-cdk-lib.CfnUpdatePolicy

interface CfnUpdatePolicy

LanguageType name
.NETAmazon.CDK.CfnUpdatePolicy
Gogithub.com/aws/aws-cdk-go/awscdk/v2#CfnUpdatePolicy
Javasoftware.amazon.awscdk.CfnUpdatePolicy
Pythonaws_cdk.CfnUpdatePolicy
TypeScript (source)aws-cdk-lib » CfnUpdatePolicy

Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource.

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 * as cdk from 'aws-cdk-lib';
const cfnUpdatePolicy: cdk.CfnUpdatePolicy = {
  autoScalingReplacingUpdate: {
    willReplace: false,
  },
  autoScalingRollingUpdate: {
    maxBatchSize: 123,
    minInstancesInService: 123,
    minSuccessfulInstancesPercent: 123,
    pauseTime: 'pauseTime',
    suspendProcesses: ['suspendProcesses'],
    waitOnResourceSignals: false,
  },
  autoScalingScheduledAction: {
    ignoreUnmodifiedGroupSizeProperties: false,
  },
  codeDeployLambdaAliasUpdate: {
    applicationName: 'applicationName',
    deploymentGroupName: 'deploymentGroupName',

    // the properties below are optional
    afterAllowTrafficHook: 'afterAllowTrafficHook',
    beforeAllowTrafficHook: 'beforeAllowTrafficHook',
  },
  enableVersionUpgrade: false,
  useOnlineResharding: false,
};

Properties

NameTypeDescription
autoScalingReplacingUpdate?CfnAutoScalingReplacingUpdateSpecifies whether an Auto Scaling group and the instances it contains are replaced during an update.
autoScalingRollingUpdate?CfnAutoScalingRollingUpdateTo specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.
autoScalingScheduledAction?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.
codeDeployLambdaAliasUpdate?CfnCodeDeployLambdaAliasUpdateTo perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.
enableVersionUpgrade?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.
useOnlineResharding?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.

autoScalingReplacingUpdate?

Type: CfnAutoScalingReplacingUpdate (optional)

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.


autoScalingRollingUpdate?

Type: CfnAutoScalingRollingUpdate (optional)

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.


autoScalingScheduledAction?

Type: CfnAutoScalingScheduledAction (optional)

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.


codeDeployLambdaAliasUpdate?

Type: CfnCodeDeployLambdaAliasUpdate (optional)

To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.


enableVersionUpgrade?

Type: boolean (optional)

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.


useOnlineResharding?

Type: boolean (optional)

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.