AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Cluster

A regional grouping of one or more container instances on which you can run tasks and services.

Import

import { Cluster } from 'aws-cdk-lib/aws-ecs';

Or use the module namespace:

import * as ecs from 'aws-cdk-lib/aws-ecs';
// ecs.Cluster

Properties

Configuration passed to the constructor as ClusterProps.

capacityOptional
AddCapacityOptions

The ec2 capacity to add to the cluster.

Default: - no EC2 capacity will be added, you can use `addCapacity` to add capacity later.

clusterNameOptional
string

The name for the cluster.

Default: CloudFormation-generated name

containerInsightsOptionalDeprecated
boolean

If true CloudWatch Container Insights will be enabled for the cluster.

Default: - Container Insights will be disabled for this cluster.

Deprecated: See {@link containerInsightsV2 }

containerInsightsV2Optional
ContainerInsights

The CloudWatch Container Insights configuration for the cluster.

Default: {@link ContainerInsights.DISABLED } This may be overridden by ECS account level settings.

defaultCloudMapNamespaceOptional
CloudMapNamespaceOptions

The service discovery namespace created in this cluster.

Default: - no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a default service discovery namespace later.

enableFargateCapacityProvidersOptional
boolean

Whether to enable Fargate Capacity Providers.

Default: false

executeCommandConfigurationOptional
ExecuteCommandConfiguration

The execute command configuration for the cluster.

Default: - no configuration will be provided.

managedStorageConfigurationOptional
ManagedStorageConfiguration

Encryption configuration for ECS Managed storage.

Default: - no encryption will be applied.

vpcOptional
IVpc

The VPC where your ECS instances will be running or your ENIs will be deployed.

Default: - creates a new VPC with two AZs

Get the Amazon ECS Cheat Sheet

Everything you need to know about Amazon ECS on one page. HD quality, print-friendly.

Download Free Infographic