interface ClusterProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ECS.ClusterProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#ClusterProps |
![]() | software.amazon.awscdk.services.ecs.ClusterProps |
![]() | aws_cdk.aws_ecs.ClusterProps |
![]() | aws-cdk-lib » aws_ecs » ClusterProps |
The properties used to define an ECS cluster.
Example
const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
isDefault: true,
});
const cluster = new ecs.Cluster(this, 'ECSCluster', { vpc });
const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
compatibility: ecs.Compatibility.FARGATE,
cpu: '256',
memoryMiB: '512'
});
taskDefinition.addContainer('TheContainer', {
image: ecs.ContainerImage.fromRegistry('foo/bar'),
});
const runTask = new tasks.EcsRunTask(this, 'Run', {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
cluster,
taskDefinition,
launchTarget: new tasks.EcsFargateLaunchTarget(),
cpu: '1024',
memoryMiB: '1048'
});
Properties
Name | Type | Description |
---|---|---|
capacity? | Add | The ec2 capacity to add to the cluster. |
cluster | string | The name for the cluster. |
container | boolean | If true CloudWatch Container Insights will be enabled for the cluster. |
container | Container | The CloudWatch Container Insights configuration for the cluster. |
default | Cloud | The service discovery namespace created in this cluster. |
enable | boolean | Whether to enable Fargate Capacity Providers. |
execute | Execute | The execute command configuration for the cluster. |
managed | Managed | Encryption configuration for ECS Managed storage. |
vpc? | IVpc | The VPC where your ECS instances will be running or your ENIs will be deployed. |
capacity?
Type:
Add
(optional, default: no EC2 capacity will be added, you can use addCapacity
to add capacity later.)
The ec2 capacity to add to the cluster.
clusterName?
Type:
string
(optional, default: CloudFormation-generated name)
The name for the cluster.
containerInsights?
⚠️ Deprecated: See {@link containerInsightsV2 }
Type:
boolean
(optional, default: Container Insights will be disabled for this cluster.)
If true CloudWatch Container Insights will be enabled for the cluster.
containerInsightsV2?
Type:
Container
(optional, default: {@link ContainerInsights.DISABLED } This may be overridden by ECS account level settings.)
The CloudWatch Container Insights configuration for the cluster.
defaultCloudMapNamespace?
Type:
Cloud
(optional, default: no service discovery namespace created, you can use addDefaultCloudMapNamespace
to add a
default service discovery namespace later.)
The service discovery namespace created in this cluster.
enableFargateCapacityProviders?
Type:
boolean
(optional, default: false)
Whether to enable Fargate Capacity Providers.
executeCommandConfiguration?
Type:
Execute
(optional, default: no configuration will be provided.)
The execute command configuration for the cluster.
managedStorageConfiguration?
Type:
Managed
(optional, default: no encryption will be applied.)
Encryption configuration for ECS Managed storage.
vpc?
Type:
IVpc
(optional, default: creates a new VPC with two AZs)
The VPC where your ECS instances will be running or your ENIs will be deployed.