6

I am trying to deploy a very simple web application to AWS Fargate.

I have pushed a docker image of the backend of the application to ECR and I am trying to setup a Fargate task definition for the container. I have all of the properties of the task defined, the setup is fairly simple, but the task wont create and I am always getting the error:

Invalid request provided: Create TaskDefinition: Fargate requires task definition to have execution role ARN to support ECR images. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID: ; Proxy: null)" (RequestToken: , HandlerErrorCode: InvalidRequest)

I know I have an ECR image and I have created and selected the IAM Role that Fargate wants (using this documentation) but it still complains.

I had originally created the task with EC2 launch type and it had no problems, but decided to go with Fargate launch type for cost and simplicity reasons.

What else do I have to do?

3 Answers 3

5

I just encountered this issue and was able to resolve it with AWS. Apparently there is a bug when adding the permissions associated with the IAM Role when using the GUI for task definitions.

To resolve this you can go to Cloud formation to specify the configuration file there. You should see your failed task definitions there. Click on the stack associated with your task definition and select Update / Edit template in designer.

Edit the JSON an add this under "TaskRoleArn": "your task role"

{
  […]
  "executionRoleArn" : "the-same-string-that-taskRoleArn-is-set-to"
  […]
}

That should resolve your issue

3
  • Thanks for posting! Any info on when the bug will be fixed? Commented May 29, 2022 at 10:30
  • The attribute should be executionRoleArn and not ExecutionRoleArn.
    – Eddie C.
    Commented Jan 19 at 17:31
  • If you follow the suggestions in the documentation for setting up log groups the Arn will be: ecsTaskExecutionRole
    – Martlark
    Commented Mar 31 at 8:41
1

This seems a bug in the new ECS UI.

Switch back to the old UI by unchecking the "New ECS Experience" option from the left sidebar, and it should work.

0

The 'update' button is disabled for me. Any ideas how to enable it or another workaround? I was able to create fargate service definitions just a few days ago, so I have templates from cloud formation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .