AWS Elastic Container Service (ECS) CI Template issue


Deploy-ECS.gitlab-ci.yml template issue

I’m on and tried deploying to AWS ECS using the instructions for including the Deploy-ECS.gitlab-ci.yml template found here.

It is failing with the following error:

Authenticating with credentials from job payload (GitLab Registry)
$ ecs update-task-definition
An error occurred (InvalidParameterException) when calling the UpdateService operation: Task definition does not support launch_type FARGATE.
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1

I believe I may have found a solution here where Ryangr() advises that the --requires-compatibilities "FARGATE" flag needs to be on added to the aws ecs register-task-definition command. This is supported by the AWS documentation

* In the AWS Management Console, for the Requires Compatibilities field, specify FARGATE.

* In the AWS CLI, specify the --requires-compatibilities option.

* In the Amazon ECS API, specify the requiresCompatibilities flag.

The issue is I don’t know how to get that added into the Deploy-ECS.gitlab-ci.yml template.

1 Like

It looks like the following issue and merge request should fix this error.