CapacityProviderStrategy

class aws_cdk.aws_ecs.CapacityProviderStrategy(*, capacity_provider, base=None, weight=None)

Bases: object

A Capacity Provider strategy to use for the service.

NOTE: defaultCapacityProviderStrategy on cluster not currently supported.

Parameters
  • capacity_provider (str) – The name of the capacity provider.

  • base (Union[int, float, 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. Default: - none

  • weight (Union[int, float, None]) – 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. Default: - 0

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ecs as ecs

capacity_provider_strategy = ecs.CapacityProviderStrategy(
    capacity_provider="capacityProvider",

    # the properties below are optional
    base=123,
    weight=123
)

Attributes

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.

Default
  • none

Return type

Union[int, float, None]

capacity_provider

The name of the capacity provider.

Return type

str

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.

Default
  • 0

Return type

Union[int, float, None]