# CfnClusterCapacityProviderAssociationsProps

Properties for defining a `CfnClusterCapacityProviderAssociations`.

Used as props by: [CfnClusterCapacityProviderAssociations](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnClusterCapacityProviderAssociations.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```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 cfnClusterCapacityProviderAssociationsProps: ecs.CfnClusterCapacityProviderAssociationsProps = {
  cluster: 'cluster',
  defaultCapacityProviderStrategy: [{
    capacityProvider: 'capacityProvider',

    // the properties below are optional
    base: 123,
    weight: 123,
  }],

  // the properties below are optional
  capacityProviders: ['capacityProviders'],
};
```

Python:

```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

cfn_cluster_capacity_provider_associations_props = ecs.CfnClusterCapacityProviderAssociationsProps(
    cluster="cluster",
    default_capacity_provider_strategy=[ecs.CfnClusterCapacityProviderAssociations.CapacityProviderStrategyProperty(
        capacity_provider="capacityProvider",

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

    # the properties below are optional
    capacity_providers=["capacityProviders"]
)
```

Java:

```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.*;

CfnClusterCapacityProviderAssociationsProps cfnClusterCapacityProviderAssociationsProps = CfnClusterCapacityProviderAssociationsProps.builder()
        .cluster("cluster")
        .defaultCapacityProviderStrategy(List.of(CapacityProviderStrategyProperty.builder()
                .capacityProvider("capacityProvider")

                // the properties below are optional
                .base(123)
                .weight(123)
                .build()))

        // the properties below are optional
        .capacityProviders(List.of("capacityProviders"))
        .build();
```

C# / .NET:

```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 cfnClusterCapacityProviderAssociationsProps = new CfnClusterCapacityProviderAssociationsProps {
    Cluster = "cluster",
    DefaultCapacityProviderStrategy = new [] { new CapacityProviderStrategyProperty {
        CapacityProvider = "capacityProvider",

        // the properties below are optional
        Base = 123,
        Weight = 123
    } },

    // the properties below are optional
    CapacityProviders = new [] { "capacityProviders" }
};
```

Golang:

```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"

cfnClusterCapacityProviderAssociationsProps := &CfnClusterCapacityProviderAssociationsProps{
	Cluster: jsii.String("cluster"),
	DefaultCapacityProviderStrategy: []interface{}{
		&CapacityProviderStrategyProperty{
			CapacityProvider: jsii.String("capacityProvider"),

			// the properties below are optional
			Base: jsii.Number(123),
			Weight: jsii.Number(123),
		},
	},

	// the properties below are optional
	CapacityProviders: []interface{}{
		jsii.String("capacityProviders"),
	},
}
```

## Properties

- `capacityProviders`: string | [ICapacityProviderRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ecs.ICapacityProviderRef.html)[] — The capacity providers to associate with the cluster.

- `cluster`: string | [IClusterRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ecs.IClusterRef.html) (required) — The cluster the capacity provider association is the target of.

- `defaultCapacityProviderStrategy`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnClusterCapacityProviderAssociations.CapacityProviderStrategyProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnClusterCapacityProviderAssociations.CapacityProviderStrategyProperty.html)[] (required) — The default capacity provider strategy to associate with the cluster.
