CapacityProviderStrategy Struct
A Capacity Provider strategy to use for the service.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const capacityProviderStrategy: ecs.CapacityProviderStrategy = {
capacityProvider: 'capacityProvider',
// the properties below are optional
base: 123,
weight: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
capacity_provider_strategy = ecs.CapacityProviderStrategy(
capacity_provider="capacityProvider",
# the properties below are optional
base=123,
weight=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
CapacityProviderStrategy capacityProviderStrategy = CapacityProviderStrategy.builder()
.capacityProvider("capacityProvider")
// the properties below are optional
.base(123)
.weight(123)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
var capacityProviderStrategy = new CapacityProviderStrategy {
CapacityProvider = "capacityProvider",
// the properties below are optional
Base = 123,
Weight = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
capacityProviderStrategy := &CapacityProviderStrategy{
CapacityProvider: jsii.String("capacityProvider"),
// the properties below are optional
Base: jsii.Number(123),
Weight: jsii.Number(123),
}
Properties
baseoptionalnumberbaseoptionalint | floatbaseoptionalNumberBaseoptionaldoubleBaseoptional*float64= none#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.
capacityProviderstringcapacity_providerstrcapacityProviderStringCapacityProviderstringCapacityProvider*stringrequired#The name of the capacity provider.
weightoptionalnumberweightoptionalint | floatweightoptionalNumberWeightoptionaldoubleWeightoptional*float64= 0#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.