-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws_ecs: TaskDefinition constraint.type 'distinctInstance' is not supported #25905
Comments
It looks like we should clarify this in the docs. You can specify In CloudFormation this is reflected in being only able to specify |
understood. at least in docs for Python CDK both Ec2Service and Ec2TaskDefinition implement the placement_constraints as |
Sorry I wasn't clear, we don't separate these in our API, I was describing how they are separated in both CloudFormation and the actual ECS API. I don't think we need to separate these on our end, but we should put in the docstring and make a check at synth time that there are some invalid configurations. |
…ints and no validation of input #25933 (#26384) Docs were unclear on valid placement constraints. You can specify distinctInstances when creating a Service, or running a task. You can specify memberOf when doing the previous two actions, or when creating a task or new revision. So far only memberOf is valid for ec2 task definitions. This pull request enhances the documentation and validation for task definition placement constraints in the aws-cdk-lib/aws-ecs package. The documentation now includes a note clarifying the valid placement constraints and a new validatePlacementConstraints method has been added to the Ec2TaskDefinition class to validate the constraints at synth time. The changes include: Enhancement of documentation in ec2-task-definition.ts to include a note about valid placement constraints. Addition of the validatePlacementConstraints method in ec2-task-definition.ts to validate placement constraints at synth time. Addition of unit tests in ec2-task-definition.test.ts to verify the correct behavior of the new validatePlacementConstraints method. Addition of integration tests to ensure overall functionality. Closes #25905. Revival of #25933 ---- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
|
Describe the bug
According to the documentation ecs.Ec2Taskdefinition supports placement_constraints attribute (which looks kinda redundant, because ecs.Ec2Service supports both placement_constraints and placement_strategies)
Stack deployment raises following exception
Expected Behavior
Either the ecs.Ec2Taskdefinition can be properly deployed with set placement_constraints attribute or it can be only defined in ecs.Ec2Service (regarding redundancy I am no quite sure, probably there are cases where definition of placement_constraints in ecs.Ec2Taskdefinition also makes sense)
Current Behavior
Error during stack deployment if placement_constraints is defined in ecs.Ec2Taskdefinition
Reproduction Steps
Define placement_constraints as follows in ecs.Ec2Taskdefinition and deploy the esc stack ()there is no error with
cdk synth
orcdk ls
)Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.83.0
Framework Version
No response
Node.js Version
18
OS
Ubuntu 20.04.5 LTS
Language
Python
Language Version
3.10.6
Other information
No response
The text was updated successfully, but these errors were encountered: