Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::ECS::Cluster

The AWS::ECS::Cluster resource creates an Amazon EC2 Container Service (Amazon ECS) cluster. This resource has no properties; use the Amazon ECS container agent to connect to the cluster. For more information, see Amazon ECS Container Agent in the Amazon EC2 Container Service Developer Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

Copy
{ "Type" : "AWS::ECS::Cluster", "Properties" : { "ClusterName" : String } }

YAML

Copy
Type: "AWS::ECS::Cluster" Properties: ClusterName: String

Properties

ClusterName

A name for the cluster. If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name. For more information, see Name Type.

Important

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

Required: No

Type: String

Update requires: Replacement

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the resource name.

In the following sample, the Ref function returns the name of the MyECSCluster cluster, such as MyStack-MyECSCluster-NT5EUXTNTXXD.

Copy
{ "Ref": "MyECSCluster" }

For more information about using the Ref function, see Ref.

Fn::GetAtt

Fn::GetAtt returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

Arn

The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Example

The following sample declares an Amazon ECS cluster:

JSON

Copy
"MyCluster": { "Type": "AWS::ECS::Cluster" }

YAML

Copy
MyCluster: Type: "AWS::ECS::Cluster"