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.
In addition to the cluster, the console automatically creates the following resources:
-
A default namespace in AWS Cloud Map that is the same name as the cluster. A namespace allows services that you create in the cluster to connect to the other services in the namespace without additional configuration.
For more information, see Interconnect Amazon ECS services.
You can modify the following options:
-
Change the default namespace associated with the cluster.
-
Turn on Container Insights.
CloudWatch Container Insights collects, aggregates, and summarizes metrics and logs from your containerized applications and microservices. Container Insights also provides diagnostic information, such as container restart failures, that you use to isolate issues and resolve them quickly. For more information, see Monitor Amazon ECS containers using Container Insights.
-
Add tags to help you identify your cluster.
Procedure
To create a new cluster (Amazon ECS console)
Open the console at https://console.aws.amazon.com/ecs/v2
. -
From the navigation bar, select the Region to use.
-
In the navigation pane, choose Clusters.
-
On the Clusters page, choose Create cluster.
-
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.
-
-
(Optional) To turn on Container Insights, expand Monitoring, and then turn on Use Container Insights.
-
(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.
-
-
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: