[ecs] unable to specify update policy when adding ASG capacity to ECS cluster
See original GitHub issueThe following code forces the updateType
prop when constructing the subsequent ASG cluster:
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()
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:7 (2 by maintainers)
Top GitHub Comments
My solution for python CDK:
If you came here from google, this would work: