@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.675Z") @Stability(value=Stable) public interface ClusterProps extends software.amazon.jsii.JsiiSerializable
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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
ClusterProps.Builder
A builder for
ClusterProps |
static class |
ClusterProps.Jsii$Proxy
An implementation for
ClusterProps |
| Modifier and Type | Method and Description |
|---|---|
static ClusterProps.Builder |
builder() |
default AddCapacityOptions |
getCapacity()
The ec2 capacity to add to the cluster.
|
default String |
getClusterName()
The name for the cluster.
|
default Boolean |
getContainerInsights()
If true CloudWatch Container Insights will be enabled for the cluster.
|
default CloudMapNamespaceOptions |
getDefaultCloudMapNamespace()
The service discovery namespace created in this cluster.
|
default Boolean |
getEnableFargateCapacityProviders()
Whether to enable Fargate Capacity Providers.
|
default ExecuteCommandConfiguration |
getExecuteCommandConfiguration()
The execute command configuration for the cluster.
|
default IVpc |
getVpc()
The VPC where your ECS instances will be running or your ENIs will be deployed.
|
@Stability(value=Stable) @Nullable default AddCapacityOptions getCapacity()
Default: - no EC2 capacity will be added, you can use `addCapacity` to add capacity later.
@Stability(value=Stable) @Nullable default String getClusterName()
Default: CloudFormation-generated name
@Stability(value=Stable) @Nullable default Boolean getContainerInsights()
Default: - Container Insights will be disabled for this cluster.
@Stability(value=Stable) @Nullable default CloudMapNamespaceOptions getDefaultCloudMapNamespace()
Default: - no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a default service discovery namespace later.
@Stability(value=Stable) @Nullable default Boolean getEnableFargateCapacityProviders()
Default: false
@Stability(value=Stable) @Nullable default ExecuteCommandConfiguration getExecuteCommandConfiguration()
Default: - no configuration will be provided.
@Stability(value=Stable) @Nullable default IVpc getVpc()
Default: - creates a new VPC with two AZs
@Stability(value=Stable) static ClusterProps.Builder builder()
ClusterProps.Builder of ClusterPropsCopyright © 2022. All rights reserved.