Class CapacityProviderStrategy.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.CapacityProviderStrategy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CapacityProviderStrategy>
- Enclosing interface:
- CapacityProviderStrategy
@Stability(Stable)
public static final class CapacityProviderStrategy.Builder
extends Object
implements software.amazon.jsii.Builder<CapacityProviderStrategy>
A builder for
CapacityProviderStrategy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCapacityProviderStrategy.getBase()
build()
Builds the configured instance.capacityProvider
(String capacityProvider) Sets the value ofCapacityProviderStrategy.getCapacityProvider()
Sets the value ofCapacityProviderStrategy.getWeight()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
capacityProvider
@Stability(Stable) public CapacityProviderStrategy.Builder capacityProvider(String capacityProvider) Sets the value ofCapacityProviderStrategy.getCapacityProvider()
- Parameters:
capacityProvider
- The name of the capacity provider. This parameter is required.- Returns:
this
-
base
Sets the value ofCapacityProviderStrategy.getBase()
- Parameters:
base
- The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.- Returns:
this
-
weight
Sets the value ofCapacityProviderStrategy.getWeight()
- Parameters:
weight
- The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CapacityProviderStrategy>
- Returns:
- a new instance of
CapacityProviderStrategy
- Throws:
NullPointerException
- if any required attribute was not provided
-