Setting up prerequisites for Fargate

In addition to configuring an ECS CLI profile, we need to set up the following prerequisites to create an ECS cluster with the FARGATE launch type:

  • Create a task execution role
  • Register the task execution policy
  • Create the task execution role

A task execution role is required to be created for a Fargate task to be able to download a Docker image and send and save container logs in CloudWatch. Create an IAM policy, execution-assume-role.json, in the C:\PowerShell\ directory, and copy and save the following JSON listing to the policy file:

{  "Version": "2012-10-17",  "Statement": [    {      "Sid": "",      "Effect": "Allow",      "Principal": {        "Service": "ecs-tasks.amazonaws.com"      },      "Action": "sts:AssumeRole"    }  ]}

Create ...

Get Amazon Fargate Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.