Interface ClusterProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ClusterProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.247Z")
@Stability(Stable)
public interface ClusterProps
extends software.amazon.jsii.JsiiSerializable
The properties used to define an ECS cluster.
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build();
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.memoryMiB("512")
.cpu("256")
.compatibility(Compatibility.FARGATE)
.build();
ContainerDefinition containerDefinition = taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("foo/bar"))
.memoryLimitMiB(256)
.build());
EcsRunTask runTask = EcsRunTask.Builder.create(this, "RunFargate")
.integrationPattern(IntegrationPattern.RUN_JOB)
.cluster(cluster)
.taskDefinition(taskDefinition)
.assignPublicIp(true)
.containerOverrides(List.of(ContainerOverride.builder()
.containerDefinition(containerDefinition)
.environment(List.of(TaskEnvironmentVariable.builder().name("SOME_KEY").value(JsonPath.stringAt("$.SomeKey")).build()))
.build()))
.launchTarget(new EcsFargateLaunchTarget())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forClusterPropsstatic final classAn implementation forClusterProps -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterProps.Builderbuilder()default AddCapacityOptionsThe ec2 capacity to add to the cluster.Deprecated.default StringThe name for the cluster.default BooleanIf true CloudWatch Container Insights will be enabled for the cluster.default CloudMapNamespaceOptionsThe service discovery namespace created in this cluster.default BooleanWhether to enable Fargate Capacity Providers.default ExecuteCommandConfigurationThe execute command configuration for the cluster.default IVpcgetVpc()The VPC where your ECS instances will be running or your ENIs will be deployed.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCapacity
The ec2 capacity to add to the cluster.Default: - no EC2 capacity will be added, you can use `addCapacity` to add capacity later.
-
getCapacityProviders
Deprecated.UseClusterProps.enableFargateCapacityProvidersinstead.(deprecated) The capacity providers to add to the cluster.Default: - None. Currently only FARGATE and FARGATE_SPOT are supported.
-
getClusterName
The name for the cluster.Default: CloudFormation-generated name
-
getContainerInsights
If true CloudWatch Container Insights will be enabled for the cluster.Default: - Container Insights will be disabled for this cluser.
-
getDefaultCloudMapNamespace
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.
-
getEnableFargateCapacityProviders
Whether to enable Fargate Capacity Providers.Default: false
-
getExecuteCommandConfiguration
The execute command configuration for the cluster.Default: - no configuration will be provided.
-
getVpc
The VPC where your ECS instances will be running or your ENIs will be deployed.Default: - creates a new VPC with two AZs
-
builder
- Returns:
- a
ClusterProps.BuilderofClusterProps
-
ClusterProps.enableFargateCapacityProvidersinstead.