Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ecs ]



Creates a new Amazon ECS cluster. By default, your account receives a default cluster when you launch your first container instance. However, you can create your own cluster with a unique name with the CreateCluster action.


When you call the CreateCluster API operation, Amazon ECS attempts to create the service-linked role for your account so that required resources in other AWS services can be managed on your behalf. However, if the IAM user that makes the call does not have permissions to create the service-linked role, it is not created. For more information, see Using Service-Linked Roles for Amazon ECS in the Amazon Elastic Container Service Developer Guide .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


[--cluster-name <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--cluster-name (string)

The name of your cluster. If you do not specify a name for your cluster, you create a cluster named default . Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To create a new cluster

This example command creates a cluster in your default region.


aws ecs create-cluster --cluster-name "my_cluster"


    "cluster": {
        "status": "ACTIVE",
        "clusterName": "my_cluster",
        "registeredContainerInstancesCount": 0,
        "pendingTasksCount": 0,
        "runningTasksCount": 0,
        "activeServicesCount": 0,
        "clusterArn": "arn:aws:ecs:<region>:<aws_account_id>:cluster/my_cluster"


cluster -> (structure)

The full description of your new cluster.

clusterArn -> (string)

The Amazon Resource Name (ARN) that identifies the cluster. The ARN contains the arn:aws:ecs namespace, followed by the Region of the cluster, the AWS account ID of the cluster owner, the cluster namespace, and then the cluster name. For example, ``arn:aws:ecs:region :012345678910 :cluster/test `` ..

clusterName -> (string)

A user-generated string that you use to identify your cluster.

status -> (string)

The status of the cluster. The valid values are ACTIVE or INACTIVE . ACTIVE indicates that you can register container instances with the cluster and the associated instances can accept tasks.

registeredContainerInstancesCount -> (integer)

The number of container instances registered into the cluster. This includes container instances in both ACTIVE and DRAINING status.

runningTasksCount -> (integer)

The number of tasks in the cluster that are in the RUNNING state.

pendingTasksCount -> (integer)

The number of tasks in the cluster that are in the PENDING state.

activeServicesCount -> (integer)

The number of services that are running on the cluster in an ACTIVE state. You can view these services with ListServices .

statistics -> (list)

Additional information about your clusters that are separated by launch type, including:

  • runningEC2TasksCount
  • RunningFargateTasksCount
  • pendingEC2TasksCount
  • pendingFargateTasksCount
  • activeEC2ServiceCount
  • activeFargateServiceCount
  • drainingEC2ServiceCount
  • drainingFargateServiceCount


A key and value pair object.

name -> (string)

The name of the key value pair. For environment variables, this is the name of the environment variable.

value -> (string)

The value of the key value pair. For environment variables, this is the value of the environment variable.