Skip to content

[ecs] unable to specify update policy when adding ASG capacity to ECS cluster #11581

@jusiskin

Description

@jusiskin

The following code forces the updateType prop when constructing the subsequent ASG cluster:

updateType: options.updateType || autoscaling.UpdateType.REPLACING_UPDATE,

The updateType prop is of type UpdateType which is now deprecated in favor of passing an UpdatePolicy but the two arguments are mutually exclusive. If you try to pass an updatePolcy prop into this function, the following error is output:

Error: Cannot set 'signals'/'updatePolicy' and 'updateType' together. Prefer 'signals'/'updatePolicy'

The only way for callers to override the default is to supply an updateType prop to override the Cluster's default behavior when using .addCapacity(...). This means the caller must use a deprecated API which is not ideal and causes linter warnings unless they are dismissed/disabled.

I believe this could be fixed by making this wrapper method aware of the mutually-exclusive props and if neither is specified, pass updatePolicy: UpdatePolicy.rollingUpdate().

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic ContainerbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions