AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ECS::CapacityProvider

CfnCapacityProvider

Creates a capacity provider. Capacity providers are associated with a cluster and are used in capacity provider strategies to facilitate cluster auto scaling. You can create capacity providers for Amazon ECS Managed Instances and EC2 instances. AWS Fargate has the predefined `FARGATE` and `FARGATE_SPOT` capacity providers.

Import

import { CfnCapacityProvider } from 'aws-cdk-lib/aws-ecs';

Or use the module namespace:

import * as ecs from 'aws-cdk-lib/aws-ecs';
// ecs.CfnCapacityProvider

Properties

Configuration passed to the constructor as CfnCapacityProviderProps.

autoScalingGroupProviderOptional
IResolvable | AutoScalingGroupProviderProperty

The Auto Scaling group settings for the capacity provider.

clusterNameOptional
string

The cluster that this capacity provider is associated with. Managed instances capacity providers are cluster-scoped, meaning they can only be used within their associated cluster. This is required for Managed instances.

managedInstancesProviderOptional
IResolvable | ManagedInstancesProviderProperty

The configuration for the Amazon ECS Managed Instances provider. This includes the infrastructure role, the launch template configuration, and tag propagation settings.

nameOptional
string

The name of the capacity provider. If a name is specified, it cannot start with `aws` , `ecs` , or `fargate` . If no name is specified, a default name in the `CFNStackName-CFNResourceName-RandomString` format is used.

tagsOptional
CfnTag[]

The metadata that you apply to the capacity provider to help you categorize and organize it. Each tag consists of a key and an optional value. You define both. The following basic restrictions apply to tags: - Maximum number of tags per resource - 50 - For each resource, each tag key must be unique, and each tag key can have only one value. - Maximum key length - 128 Unicode characters in UTF-8 - Maximum value length - 256 Unicode characters in UTF-8 - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : /

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon ECS Cheat Sheet

Everything you need to know about Amazon ECS on one page. HD quality, print-friendly.

Download Free Infographic