AWS CloudFormation
User Guide (Version )

AWS::ECS::Cluster

The AWS::ECS::Cluster resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.

Syntax

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

JSON

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

YAML

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

Properties

ClusterName

A user-generated string that you use to identify your cluster. If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.

Required: No

Type: String

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name.

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

{ "Ref": "MyECSCluster" }

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

Fn::GetAtt

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

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

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

Examples

Creating an Amazon ECS cluster

The following sample declares an Amazon ECS cluster:

JSON

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

YAML

MyCluster: Type: AWS::ECS::Cluster