-
Notifications
You must be signed in to change notification settings - Fork 4.5k
AutoScaling: Invalid Autoscaling rolling update policy: PauseTime must be in the ISO8601 time period format #1113
Description
When attempting to deploy an AutoScalingGroup, I receive the following error:
[3/4] Thu Nov 08 2018 14:44:55 GMT+1100 (Australian Eastern Daylight Time) UPDATE_FAILED [AWS::AutoScaling::AutoScalingGroup] AutoScalingGroupASG804C35BE Invalid Autoscaling rolling update policy: PauseTime must be in the ISO8601 time period format and must be no greater than PT3600S seconds, e.g. "PT5M30S" specifies a pause time of 5 minutes and 30 seconds.
The snippet from my code:
const asg = new autoscaling.AutoScalingGroup(this, 'AutoScalingGroup', {
vpc,
..snip..
updateType: autoscaling.UpdateType.RollingUpdate,
rollingUpdateConfiguration: {
waitOnResourceSignals: true,
}
});Synthesising this as yaml we can see that PauseTime is set to an invalid value PT:
AutoScalingGroupASG804C35BE:
Type: 'AWS::AutoScaling::AutoScalingGroup'
..snip..
UpdatePolicy:
AutoScalingRollingUpdate:
WaitOnResourceSignals: false
PauseTime: PT
SuspendProcesses:
- HealthCheck
- ReplaceUnhealthy
- AZRebalance
- AlarmNotification
- ScheduledActionsLooking at the definition of RollingUpdateConfiguration, it implies that it is an optional parameter, and that a sane default will be used:
/**
* The pause time after making a change to a batch of instances.
*
* This is intended to give those instances time to start software applications.
*
* Specify PauseTime in the ISO8601 duration format (in the format
* PT#H#M#S, where each # is the number of hours, minutes, and seconds,
* respectively). The maximum PauseTime is one hour (PT1H).
*
* @default 300 if the waitOnResourceSignals property is true, otherwise 0
*/
pauseTimeSec?: number;It seems that when I am using the waitOnResourceSignals as suggested, there is no default value being set. Based on this, I would call this issue a bug. The documentation also implies that I should be providing a formatted string, yet the types enforce a number.
Expected value in my synthesised yaml would be based on the above documentation is:
AutoScalingGroupASG804C35BE:
Type: 'AWS::AutoScaling::AutoScalingGroup'
..snip..
UpdatePolicy:
AutoScalingRollingUpdate:
WaitOnResourceSignals: false
PauseTime: PT300SManually setting the pauseTimeSec key to 300 results in an expected yaml output: PauseTime: PT5M