Creating an Amazon ECS cluster for the Fargate launch type - Amazon Elastic Container Service

Creating an Amazon ECS cluster for the Fargate launch type

You create a cluster to define the infrastructure your tasks and services run on.

Before you begin, be sure that you've completed the steps in Set up to use Amazon ECS and assign the appropriate IAM permission. For more information, see Amazon ECS cluster examples. The Amazon ECS console creates the resources that are needed by an Amazon ECS cluster by creating a AWS CloudFormation stack.

The console automatically associates the Fargate and Fargate Spot capacity providers with the cluster.

You can modify the following options:

  • Add a namespace to the cluster.

    A namespace allows services that you create in the cluster can connect to the other services in the namespace without additional configuration. For more information, see Interconnect Amazon ECS services.

  • Add tags to help you identify your cluster.

  • Assign an AWS KMS key for your managed storage. For information about how to create a key, see Create a KMS key in the AWS Key Management Service User Guide.

  • Assign an AWS KMS key for your Fargate ephemeral storage. For information about how to create a key, see Create a KMS key in the AWS Key Management Service User Guide.

  • Configure the AWS KMS key and logging for ECS Exec.

Procedure

To create a new cluster (Amazon ECS console)
  1. Open the console at https://console.aws.amazon.com/ecs/v2.

  2. From the navigation bar, select the Region to use.

  3. In the navigation pane, choose Clusters.

  4. On the Clusters page, choose Create cluster.

  5. Under Cluster configuration, configure the following:

    • For Cluster name, enter a unique name.

      The name can contain up to 255 letters (uppercase and lowercase), numbers, and hyphens.

    • (Optional) To have the namespace used for Service Connect be different from the cluster name, for Namespace, enter a unique name.

  6. (Optional) Use Container Insights, expand Monitoring, and then choose one of the following options:

    • To use the recommended Container Insights with enhanced observability, choose Container Insights with enhanced observability.

    • To use Container Insights, choose Container Insights.

  7. (Optional) To use ECS Exec to debug tasks in the cluster, expand Troubleshooting configuration, and then configure the following:

    • (Optional) For AWS KMS key for ECS Exec, enter the ARN of the AWS KMS key you want to use to encrypt the ECS Exec session data.

    • (Optional) For ECS Exec logging, choose the log destination:

      • To send logs to CloudWatch Logs, choose Amazon CloudWatch.

      • To send logs to Amazon S3, choose Amazon S3.

      • To disable logging, choose None.

  8. (Optional), Under Encryption, you can configure the following:

    • Encrypt your data on Fargate ephemeral storage. Under Encryption, for Fargate ephemeral storage, enter the ARN of the AWS KMS key you want to use to encrypt the Fargate ephemeral storage data.

    • Encrypt the data on managed storage. Under Encryption, for Managed storage, enter the ARN of the AWS KMS key you want to use to encrypt the managed storage data.

  9. (Optional) To help identify your cluster, expand Tags, and then configure your tags.

    [Add a tag] Choose Add tag and do the following:

    • For Key, enter the key name.

    • For Value, enter the key value.

    [Remove a tag] Choose Remove to the right of the tag’s Key and Value.

  10. Choose Create.

Next steps

After you create the cluster, you can create task definitions for your applications and then run them as standalone tasks, or as part of a service. For more information, see the following: