Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoScaling: Invalid Autoscaling rolling update policy: PauseTime must be in the ISO8601 time period format #1113

Closed
0xdevalias opened this issue Nov 8, 2018 · 1 comment · Fixed by #1134
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling bug This issue is a bug.

Comments

@0xdevalias
Copy link
Contributor

0xdevalias commented Nov 8, 2018

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
            - ScheduledActions

Looking 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: PT300S

Manually setting the pauseTimeSec key to 300 results in an expected yaml output: PauseTime: PT5M

@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 8, 2018

Yep, thanks for the report.

Came across this recently, in the process of fixing it in a PR already.

@rix0rrr rix0rrr added the bug This issue is a bug. label Nov 8, 2018
@debora-ito debora-ito added the @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling label Nov 8, 2018
rix0rrr pushed a commit that referenced this issue Nov 9, 2018
It's now possible to add autoscaling policies (step scaling, target
tracking, and scheduled) to AutoScalingGroup. It's also possible to add
lifecycle hooks to an AutoScalingGroup, which will publish messages to
SQS queues or SNS topics.

ALSO IN THIS COMMIT

- Fix an issue where an invalid PauseTime is generated on
  AutoScalingGroup.

Fixes #1042, fixes #1113.
rix0rrr added a commit that referenced this issue Nov 15, 2018
It's now possible to add autoscaling policies (step scaling, target
tracking, and scheduled) to AutoScalingGroup. It's also possible to add
lifecycle hooks to an AutoScalingGroup, which will publish messages to
SQS queues or SNS topics.

ALSO IN THIS COMMIT

- Fix an issue where an invalid PauseTime is generated on
  AutoScalingGroup.

Fixes #1042, fixes #1113.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants