-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[ecs] unable to specify update policy when adding ASG capacity to ECS cluster #11581
Description
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().