capacity_providers
Creates, updates, deletes, gets or lists a capacity_providers resource.
Overview
| Name | capacity_providers |
| Type | Resource |
| Id | aws.ecs.capacity_providers |
Fields
The following fields are returned by SELECT queries:
- describe_capacity_providers
| Name | Datatype | Description |
|---|---|---|
capacity_providers | array | The list of capacity providers. |
failures | array | Any failures associated with the call. |
next_token | string | The nextToken value to include in a future DescribeCapacityProviders request. When the results of a DescribeCapacityProviders request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_capacity_providers | select | region | Describes one or more of your capacity providers. | |
create_capacity_provider | insert | region, name | 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. Fargate has the predefined FARGATE and FARGATE_SPOT capacity providers. | |
update_capacity_provider | update | region, name | Modifies the parameters for a capacity provider. These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones. | |
put_cluster_capacity_providers | replace | region, cluster, capacityProviders, defaultCapacityProviderStrategy | Modifies the available capacity providers and the default capacity provider strategy for a cluster. You must specify both the available capacity providers and a default capacity provider strategy for the cluster. If the specified cluster has existing capacity providers associated with it, you must specify all existing capacity providers in addition to any new ones you want to add. Any existing capacity providers that are associated with a cluster that are omitted from a PutClusterCapacityProviders API call will be disassociated with the cluster. You can only disassociate an existing capacity provider from a cluster if it's not being used by any existing tasks. When creating a service or running a task on a cluster, if no capacity provider or launch type is specified, then the cluster's default capacity provider strategy is used. We recommend that you define a default capacity provider strategy for your cluster. However, you must specify an empty array ([]) to bypass defining a default strategy. Amazon ECS Managed Instances doesn't support this, because when you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster. | |
delete_capacity_provider | delete | region | Deletes the specified capacity provider. The FARGATE and FARGATE_SPOT capacity providers are reserved and can't be deleted. You can disassociate them from a cluster using either PutClusterCapacityProviders or by deleting the cluster. Prior to a capacity provider being deleted, the capacity provider must be removed from the capacity provider strategy from all services. The UpdateService API can be used to remove a capacity provider from a service's capacity provider strategy. When updating a service, the forceNewDeployment option can be used to ensure that any tasks using the Amazon EC2 instance capacity provided by the capacity provider are transitioned to use the capacity from the remaining capacity providers. Only capacity providers that aren't associated with a cluster can be deleted. To remove a capacity provider from a cluster, you can either use PutClusterCapacityProviders or delete the cluster. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_capacity_providers
Describes one or more of your capacity providers.
SELECT
capacity_providers,
failures,
next_token
FROM aws.ecs.capacity_providers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_capacity_provider
- Manifest
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. Fargate has the predefined FARGATE and FARGATE_SPOT capacity providers.
INSERT INTO aws.ecs.capacity_providers (
name,
cluster,
autoScalingGroupProvider,
managedInstancesProvider,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ cluster }}',
'{{ autoScalingGroupProvider }}',
'{{ managedInstancesProvider }}',
'{{ tags }}',
'{{ region }}'
RETURNING
capacity_provider
;
# Description fields are for documentation purposes
- name: capacity_providers
props:
- name: region
value: "{{ region }}"
description: Required parameter for the capacity_providers resource.
- name: name
value: "{{ name }}"
description: |
The name of the capacity provider. Up to 255 characters are allowed. They include letters (both upper and lowercase letters), numbers, underscores (_), and hyphens (-). The name can't be prefixed with "aws", "ecs", or "fargate".
- name: cluster
value: "{{ cluster }}"
description: |
The name of the cluster to associate with the capacity provider. When you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster.
- name: autoScalingGroupProvider
description: |
The details of the Auto Scaling group for the capacity provider.
value:
autoScalingGroupArn: "{{ autoScalingGroupArn }}"
managedScaling:
status: "{{ status }}"
targetCapacity: {{ targetCapacity }}
minimumScalingStepSize: {{ minimumScalingStepSize }}
maximumScalingStepSize: {{ maximumScalingStepSize }}
instanceWarmupPeriod: {{ instanceWarmupPeriod }}
managedTerminationProtection: "{{ managedTerminationProtection }}"
managedDraining: "{{ managedDraining }}"
- name: managedInstancesProvider
description: |
The configuration for the Amazon ECS Managed Instances provider. This configuration specifies how Amazon ECS manages Amazon EC2 instances on your behalf, including the infrastructure role, instance launch template, and tag propagation settings.
value:
infrastructureRoleArn: "{{ infrastructureRoleArn }}"
instanceLaunchTemplate:
ec2InstanceProfileArn: "{{ ec2InstanceProfileArn }}"
networkConfiguration:
subnets:
- "{{ subnets }}"
securityGroups:
- "{{ securityGroups }}"
storageConfiguration:
storageSizeGiB: {{ storageSizeGiB }}
localStorageConfiguration:
useLocalStorage: {{ useLocalStorage }}
monitoring: "{{ monitoring }}"
capacityOptionType: "{{ capacityOptionType }}"
instanceMetadataTagsPropagation: {{ instanceMetadataTagsPropagation }}
instanceRequirements:
vCpuCount:
min: {{ min }}
max: {{ max }}
memoryMiB:
min: {{ min }}
max: {{ max }}
cpuManufacturers:
- "{{ cpuManufacturers }}"
memoryGiBPerVCpu:
min: {{ min }}
max: {{ max }}
excludedInstanceTypes:
- "{{ excludedInstanceTypes }}"
instanceGenerations:
- "{{ instanceGenerations }}"
spotMaxPricePercentageOverLowestPrice: {{ spotMaxPricePercentageOverLowestPrice }}
onDemandMaxPricePercentageOverLowestPrice: {{ onDemandMaxPricePercentageOverLowestPrice }}
bareMetal: "{{ bareMetal }}"
burstablePerformance: "{{ burstablePerformance }}"
requireHibernateSupport: {{ requireHibernateSupport }}
networkInterfaceCount:
min: {{ min }}
max: {{ max }}
localStorage: "{{ localStorage }}"
localStorageTypes:
- "{{ localStorageTypes }}"
totalLocalStorageGB:
min: {{ min }}
max: {{ max }}
baselineEbsBandwidthMbps:
min: {{ min }}
max: {{ max }}
acceleratorTypes:
- "{{ acceleratorTypes }}"
acceleratorCount:
min: {{ min }}
max: {{ max }}
acceleratorManufacturers:
- "{{ acceleratorManufacturers }}"
acceleratorNames:
- "{{ acceleratorNames }}"
acceleratorTotalMemoryMiB:
min: {{ min }}
max: {{ max }}
networkBandwidthGbps:
min: {{ min }}
max: {{ max }}
allowedInstanceTypes:
- "{{ allowedInstanceTypes }}"
maxSpotPriceAsPercentageOfOptimalOnDemandPrice: {{ maxSpotPriceAsPercentageOfOptimalOnDemandPrice }}
fipsEnabled: {{ fipsEnabled }}
capacityReservations:
reservationGroupArn: "{{ reservationGroupArn }}"
reservationPreference: "{{ reservationPreference }}"
propagateTags: "{{ propagateTags }}"
infrastructureOptimization:
scaleInAfter: {{ scaleInAfter }}
autoRepairConfiguration:
actionsStatus: "{{ actionsStatus }}"
- name: tags
description: |
The metadata that you apply to the capacity provider to categorize and organize them more conveniently. Each tag consists of a key and an optional value. You define both of them. 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: + - = . _ : / @. Tag keys and values are case-sensitive. Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_capacity_provider
Modifies the parameters for a capacity provider. These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones.
UPDATE aws.ecs.capacity_providers
SET
name = '{{ name }}',
cluster = '{{ cluster }}',
autoScalingGroupProvider = '{{ autoScalingGroupProvider }}',
managedInstancesProvider = '{{ managedInstancesProvider }}'
WHERE
region = '{{ region }}' --required
AND name = '{{ name }}' --required
RETURNING
capacity_provider;
REPLACE examples
- put_cluster_capacity_providers
Modifies the available capacity providers and the default capacity provider strategy for a cluster. You must specify both the available capacity providers and a default capacity provider strategy for the cluster. If the specified cluster has existing capacity providers associated with it, you must specify all existing capacity providers in addition to any new ones you want to add. Any existing capacity providers that are associated with a cluster that are omitted from a PutClusterCapacityProviders API call will be disassociated with the cluster. You can only disassociate an existing capacity provider from a cluster if it's not being used by any existing tasks. When creating a service or running a task on a cluster, if no capacity provider or launch type is specified, then the cluster's default capacity provider strategy is used. We recommend that you define a default capacity provider strategy for your cluster. However, you must specify an empty array ([]) to bypass defining a default strategy. Amazon ECS Managed Instances doesn't support this, because when you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster.
REPLACE aws.ecs.capacity_providers
SET
cluster = '{{ cluster }}',
capacityProviders = '{{ capacityProviders }}',
defaultCapacityProviderStrategy = '{{ defaultCapacityProviderStrategy }}'
WHERE
region = '{{ region }}' --required
AND cluster = '{{ cluster }}' --required
AND capacityProviders = '{{ capacityProviders }}' --required
AND defaultCapacityProviderStrategy = '{{ defaultCapacityProviderStrategy }}' --required
RETURNING
cluster;
DELETE examples
- delete_capacity_provider
Deletes the specified capacity provider. The FARGATE and FARGATE_SPOT capacity providers are reserved and can't be deleted. You can disassociate them from a cluster using either PutClusterCapacityProviders or by deleting the cluster. Prior to a capacity provider being deleted, the capacity provider must be removed from the capacity provider strategy from all services. The UpdateService API can be used to remove a capacity provider from a service's capacity provider strategy. When updating a service, the forceNewDeployment option can be used to ensure that any tasks using the Amazon EC2 instance capacity provided by the capacity provider are transitioned to use the capacity from the remaining capacity providers. Only capacity providers that aren't associated with a cluster can be deleted. To remove a capacity provider from a cluster, you can either use PutClusterCapacityProviders or delete the cluster.
DELETE FROM aws.ecs.capacity_providers
WHERE region = '{{ region }}' --required
;