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 Summary
Modifier and TypeMethodDescriptionbuild()
capacity
(AddCapacityOptions capacity) The ec2 capacity to add to the cluster.capacityProviders
(List<String> capacityProviders) Deprecated.clusterName
(String clusterName) The name for the cluster.containerInsights
(Boolean containerInsights) If true CloudWatch Container Insights will be enabled for the cluster.static Cluster.Builder
defaultCloudMapNamespace
(CloudMapNamespaceOptions defaultCloudMapNamespace) The service discovery namespace created in this cluster.enableFargateCapacityProviders
(Boolean enableFargateCapacityProviders) Whether to enable Fargate Capacity Providers.executeCommandConfiguration
(ExecuteCommandConfiguration executeCommandConfiguration) The execute command configuration for the cluster.The VPC where your ECS instances will be running or your ENIs will be deployed.
-
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
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
-
capacityProviders
@Stability(Deprecated) @Deprecated public Cluster.Builder capacityProviders(List<String> capacityProviders) Deprecated.Useinvalid @link
ClusterProps.enableFargateCapacityProviders
(deprecated) The capacity providers to add to the cluster.Default: - None. Currently only FARGATE and FARGATE_SPOT are supported.
- Parameters:
capacityProviders
- The capacity providers to add to the cluster. This parameter is required.- Returns:
this
-
clusterName
The name for the cluster.Default: CloudFormation-generated name
- Parameters:
clusterName
- The name for the cluster. This parameter is required.- Returns:
this
-
containerInsights
If true CloudWatch Container Insights will be enabled for the cluster.Default: - Container Insights will be disabled for this cluser.
- 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
-
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
-
invalid @link