Class CfnUpdatePolicy
Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource.
Inheritance
Implements
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnUpdatePolicy : Object, ICfnUpdatePolicy
Syntax (vb)
Public Class CfnUpdatePolicy
Inherits Object
Implements ICfnUpdatePolicy
Remarks
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.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var cfnUpdatePolicy = new CfnUpdatePolicy {
AutoScalingReplacingUpdate = new CfnAutoScalingReplacingUpdate {
WillReplace = false
},
AutoScalingRollingUpdate = new CfnAutoScalingRollingUpdate {
MaxBatchSize = 123,
MinInstancesInService = 123,
MinSuccessfulInstancesPercent = 123,
PauseTime = "pauseTime",
SuspendProcesses = new [] { "suspendProcesses" },
WaitOnResourceSignals = false
},
AutoScalingScheduledAction = new CfnAutoScalingScheduledAction {
IgnoreUnmodifiedGroupSizeProperties = false
},
CodeDeployLambdaAliasUpdate = new CfnCodeDeployLambdaAliasUpdate {
ApplicationName = "applicationName",
DeploymentGroupName = "deploymentGroupName",
// the properties below are optional
AfterAllowTrafficHook = "afterAllowTrafficHook",
BeforeAllowTrafficHook = "beforeAllowTrafficHook"
},
EnableVersionUpgrade = false,
UseOnlineResharding = false
};
Synopsis
Constructors
CfnUpdatePolicy() |
Properties
AutoScalingReplacingUpdate | Specifies whether an Auto Scaling group and the instances it contains are replaced during an update. |
AutoScalingRollingUpdate | To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy. |
AutoScalingScheduledAction | 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 | To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy. |
EnableVersionUpgrade | 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 | 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. |
Constructors
CfnUpdatePolicy()
public CfnUpdatePolicy()
Properties
AutoScalingReplacingUpdate
Specifies whether an Auto Scaling group and the instances it contains are replaced during an update.
public ICfnAutoScalingReplacingUpdate AutoScalingReplacingUpdate { get; set; }
Property Value
ICfnAutoScalingReplacingUpdate
Remarks
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
To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.
public ICfnAutoScalingRollingUpdate AutoScalingRollingUpdate { get; set; }
Property Value
Remarks
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
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.
public ICfnAutoScalingScheduledAction AutoScalingScheduledAction { get; set; }
Property Value
ICfnAutoScalingScheduledAction
CodeDeployLambdaAliasUpdate
To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.
public ICfnCodeDeployLambdaAliasUpdate CodeDeployLambdaAliasUpdate { get; set; }
Property Value
ICfnCodeDeployLambdaAliasUpdate
EnableVersionUpgrade
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.
public Nullable<bool> EnableVersionUpgrade { get; set; }
Property Value
System.Nullable<System.Boolean>
UseOnlineResharding
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.
public Nullable<bool> UseOnlineResharding { get; set; }
Property Value
System.Nullable<System.Boolean>