CfnUpdatePolicy

class aws_cdk.core.CfnUpdatePolicy(*, auto_scaling_replacing_update=None, auto_scaling_rolling_update=None, auto_scaling_scheduled_action=None, code_deploy_lambda_alias_update=None, enable_version_upgrade=None, use_online_resharding=None)

Bases: object

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.

Parameters:
  • auto_scaling_replacing_update (Union[CfnAutoScalingReplacingUpdate, Dict[str, Any], None]) – 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.

  • auto_scaling_rolling_update (Union[CfnAutoScalingRollingUpdate, Dict[str, Any], None]) – 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.

  • auto_scaling_scheduled_action (Union[CfnAutoScalingScheduledAction, Dict[str, Any], None]) – 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.

  • code_deploy_lambda_alias_update (Union[CfnCodeDeployLambdaAliasUpdate, Dict[str, Any], None]) – To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.

  • enable_version_upgrade (Optional[bool]) – 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.

  • use_online_resharding (Optional[bool]) – 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.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.core as cdk

cfn_update_policy = cdk.CfnUpdatePolicy(
    auto_scaling_replacing_update=cdk.CfnAutoScalingReplacingUpdate(
        will_replace=False
    ),
    auto_scaling_rolling_update=cdk.CfnAutoScalingRollingUpdate(
        max_batch_size=123,
        min_instances_in_service=123,
        min_successful_instances_percent=123,
        pause_time="pauseTime",
        suspend_processes=["suspendProcesses"],
        wait_on_resource_signals=False
    ),
    auto_scaling_scheduled_action=cdk.CfnAutoScalingScheduledAction(
        ignore_unmodified_group_size_properties=False
    ),
    code_deploy_lambda_alias_update=cdk.CfnCodeDeployLambdaAliasUpdate(
        application_name="applicationName",
        deployment_group_name="deploymentGroupName",

        # the properties below are optional
        after_allow_traffic_hook="afterAllowTrafficHook",
        before_allow_traffic_hook="beforeAllowTrafficHook"
    ),
    enable_version_upgrade=False,
    use_online_resharding=False
)

Attributes

auto_scaling_replacing_update

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.

auto_scaling_rolling_update

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.

auto_scaling_scheduled_action

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.

code_deploy_lambda_alias_update

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

enable_version_upgrade

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.

use_online_resharding

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.