on my CI i have configured the deploy on the AWS ECS environment via bash script
**deploy.sh**
[...]
aws ecs register-task-definition --cli-input-json file://./deploy/skeleton.json
TASK_DEFINITION_ARN=$(aws ecs --output text list-task-definitions --family-prefix "${PROJECT_NAME}" --sort DESC --query "taskDefinitionArns[0]")
aws ecs update-service \
--cluster "${PROJECT_NAME}" \
--service "${PROJECT_NAME}" \
--task-definition "${TASK_DEFINITION_ARN}" \
--force-new-deployment \
--deployment-configuration "maximumPercent=200,minimumHealthyPercent=100" \
--desired-count ${DESIRED_COUNT}
[...]
and
**skeleton.json**
{
"family": "backend",
"executionRoleArn": "arn:aws:iam::000000000000:role/XXXX",
"taskRoleArn": "arn:aws:iam::0000000:role/XXXX",
"networkMode": "awsvpc",
"containerDefinitions":
[{
"name": "csharp",
"essential": true,
"environment":[{
"name" : "CONNECTIONSTRINGS__Redis",
"value" : "XXXX"
},
{
"name" : "CONNECTIONSTRINGS__Database",
"value" : "XXX"
},
{
"name" : "ASPNETCORE_ENVIRONMENT",
"value" : "XXX"
}],
"image": "00000000.dkr.ecr.eu-west-1.amazonaws.com/prj/backend:643105ef",
"portMappings": [
{
"containerPort": 80,
"protocol": "tcp"
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/backend/",
"awslogs-region": "eu-west-1",
"awslogs-stream-prefix": "csharp"
}
}
}],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "256",
"memory": "512"
}
when i try to deploy with update-service the cli answer with:
An error occurred (InvalidParameterException) when calling the UpdateService operation: The container backend does not exist in the task definition.
but if i change in the json the container name from csharp to backend, the deploy works.
is that a bug? thx