Interface ClusterProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ClusterProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:01.041Z") @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, "ECSCluster").vpc(vpc).build();
 TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
         .compatibility(Compatibility.FARGATE)
         .cpu("256")
         .memoryMiB("512")
         .build();
 taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
         .image(ContainerImage.fromRegistry("foo/bar"))
         .build());
 EcsRunTask runTask = EcsRunTask.Builder.create(this, "Run")
         .integrationPattern(IntegrationPattern.RUN_JOB)
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .launchTarget(new EcsFargateLaunchTarget())
         .cpu("1024")
         .memoryMiB("1048")
         .build();
 
  • Method Details

    • getCapacity

      @Stability(Stable) @Nullable default AddCapacityOptions getCapacity()
      The ec2 capacity to add to the cluster.

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

    • getClusterName

      @Stability(Stable) @Nullable default String getClusterName()
      The name for the cluster.

      Default: CloudFormation-generated name

    • getContainerInsights

      @Stability(Stable) @Nullable default Boolean getContainerInsights()
      If true CloudWatch Container Insights will be enabled for the cluster.

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

    • getDefaultCloudMapNamespace

      @Stability(Stable) @Nullable default CloudMapNamespaceOptions 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

      @Stability(Stable) @Nullable default Boolean getEnableFargateCapacityProviders()
      Whether to enable Fargate Capacity Providers.

      Default: false

    • getExecuteCommandConfiguration

      @Stability(Stable) @Nullable default ExecuteCommandConfiguration getExecuteCommandConfiguration()
      The execute command configuration for the cluster.

      Default: - no configuration will be provided.

    • getManagedStorageConfiguration

      @Stability(Stable) @Nullable default ManagedStorageConfiguration getManagedStorageConfiguration()
      Encryption configuration for ECS Managed storage.

      Default: - no encryption will be applied.

    • getVpc

      @Stability(Stable) @Nullable default IVpc 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

      @Stability(Stable) static ClusterProps.Builder builder()
      Returns:
      a ClusterProps.Builder of ClusterProps