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)
ecs.Ec2TaskDefinition(
self,
id",
family="ecs-family",
task_role=task_role,
placement_constraints=[ecs.PlacementConstraint.distinct_instances()],
)
Stack deployment raises following exception
Resource handler returned message: "Invalid request provided: Create TaskDefinition: constraint.type 'distinctInstance' is not supported. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID: 71214110-96ed-4631-a83e-74a3
8206a8db; Proxy: null)" (RequestToken: 59dedc0b-cb70-0b09-c0f5-9b580c5fe3da, HandlerErrorCode: InvalidRequest)
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 or cdk ls)
ecs.Ec2TaskDefinition(
self,
id",
family="ecs-family",
task_role=task_role,
placement_constraints=[ecs.PlacementConstraint.distinct_instances()],
)
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
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 synthorcdk 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