Class Cluster.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.Cluster.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Cluster>
Enclosing class:
Cluster

@Stability(Stable) public static final class Cluster.Builder extends Object implements software.amazon.jsii.Builder<Cluster>
A fluent builder for Cluster.
  • Method Details

    • create

      @Stability(Stable) public static Cluster.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Cluster.Builder.
    • capacity

      @Stability(Stable) public Cluster.Builder capacity(AddCapacityOptions capacity)
      The ec2 capacity to add to the cluster.

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

      Parameters:
      capacity - The ec2 capacity to add to the cluster. This parameter is required.
      Returns:
      this
    • clusterName

      @Stability(Stable) public Cluster.Builder clusterName(String clusterName)
      The name for the cluster.

      Default: CloudFormation-generated name

      Parameters:
      clusterName - The name for the cluster. This parameter is required.
      Returns:
      this
    • containerInsights

      @Stability(Stable) public Cluster.Builder containerInsights(Boolean containerInsights)
      If true CloudWatch Container Insights will be enabled for the cluster.

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

      Parameters:
      containerInsights - If true CloudWatch Container Insights will be enabled for the cluster. This parameter is required.
      Returns:
      this
    • defaultCloudMapNamespace

      @Stability(Stable) public Cluster.Builder defaultCloudMapNamespace(CloudMapNamespaceOptions defaultCloudMapNamespace)
      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.

      Parameters:
      defaultCloudMapNamespace - The service discovery namespace created in this cluster. This parameter is required.
      Returns:
      this
    • enableFargateCapacityProviders

      @Stability(Stable) public Cluster.Builder enableFargateCapacityProviders(Boolean enableFargateCapacityProviders)
      Whether to enable Fargate Capacity Providers.

      Default: false

      Parameters:
      enableFargateCapacityProviders - Whether to enable Fargate Capacity Providers. This parameter is required.
      Returns:
      this
    • executeCommandConfiguration

      @Stability(Stable) public Cluster.Builder executeCommandConfiguration(ExecuteCommandConfiguration executeCommandConfiguration)
      The execute command configuration for the cluster.

      Default: - no configuration will be provided.

      Parameters:
      executeCommandConfiguration - The execute command configuration for the cluster. This parameter is required.
      Returns:
      this
    • managedStorageConfiguration

      @Stability(Stable) public Cluster.Builder managedStorageConfiguration(ManagedStorageConfiguration managedStorageConfiguration)
      Encryption configuration for ECS Managed storage.

      Default: - no encryption will be applied.

      Parameters:
      managedStorageConfiguration - Encryption configuration for ECS Managed storage. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public Cluster.Builder vpc(IVpc vpc)
      The VPC where your ECS instances will be running or your ENIs will be deployed.

      Default: - creates a new VPC with two AZs

      Parameters:
      vpc - The VPC where your ECS instances will be running or your ENIs will be deployed. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Cluster build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Cluster>
      Returns:
      a newly built instance of Cluster.