ECS Run Task does not work if Launch Type is passed as argument. #4160
Labels
bug
This issue is a confirmed bug.
ecs
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
I have a task definition that runs on ECS and uses EC2 as its launch type.
When calling this, the task is submitted successfully to the cluster, even if there are no running instances (I have my ASG taking care of that):
Response:
But if I submit my task passing launch type as a parameter, the call will error out when there are no instances running on the cluster:
Error log:
Expected Behavior
The API call should for run task should work when submitting a task to a cluster with no instances when I pass in launch type as a parameter.
Current Behavior
The run task API does not work when submitting launch type as a parameter if the cluster has no running instances.
Reproduction Steps
ecs_client = boto3.client('ecs')
def_dict = {
"cluster":"ecs-gpu-cluster",
"launchType":"EC2",
"taskDefinition":"arn:aws:ecs:us-east-2:058442094236:task-definition/prefect_ecs-gpu-pool_47cd3a8c-d732-4670-83e5-1d12e2f43d6d:8",
}
ecs_client.run_task(**def_dict)
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.34.122
Environment details (OS name and version, etc.)
Linux
The text was updated successfully, but these errors were encountered: