Deletes the specified capacity provider.
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.
See also: AWS API Documentation
delete-capacity-provider
--capacity-provider <value>
[--cluster <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
--capacity-provider
(string) [required]
The short name or full Amazon Resource Name (ARN) of the capacity provider to delete.
--cluster
(string)
The name of the cluster that contains the capacity provider to delete. Managed instances capacity providers are cluster-scoped and can only be deleted from their associated cluster.
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command’s default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format
(string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb://
will always be treated as binary and use the file contents directly regardless of the cli-binary-format
setting. When using file://
the file contents will need to properly formatted for the configured cli-binary-format
.
--no-cli-pager
(boolean)
Disable cli pager for output.
--cli-auto-prompt
(boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt
(boolean)
Disable automatically prompt for CLI input parameters.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Example 1: To delete a capacity provider using the Amazon Resource Name (ARN)
The following delete-capacity-provider
example deletes a capacity provider by specifying the Amazon Resource Name (ARN) of the capacity provider. The ARN as well as the status of the capacity provider deletion can be retrieved using the describe-capacity-providers
command.
aws ecs delete-capacity-provider \
--capacity-provider arn:aws:ecs:us-west-2:123456789012:capacity-provider/ExampleCapacityProvider
Output:
{
"capacityProvider": {
"capacityProviderArn": "arn:aws:ecs:us-west-2:123456789012:capacity-provider/ExampleCapacityProvider",
"name": "ExampleCapacityProvider",
"status": "ACTIVE",
"autoScalingGroupProvider": {
"autoScalingGroupArn": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
"managedScaling": {
"status": "ENABLED",
"targetCapacity": 100,
"minimumScalingStepSize": 1,
"maximumScalingStepSize": 10000
},
"managedTerminationProtection": "DISABLED"
},
"updateStatus": "DELETE_IN_PROGRESS",
"tags": []
}
}
For more information, see Cluster capacity providers in the Amazon ECS Developer Guide.
Example 2: To delete a capacity provider using the name
The following delete-capacity-provider
example deletes a capacity provider by specifying the short name of the capacity provider. The short name as well as the status of the capacity provider deletion can be retrieved using the describe-capacity-providers
command.
aws ecs delete-capacity-provider \
--capacity-provider ExampleCapacityProvider
Output:
{
"capacityProvider": {
"capacityProviderArn": "arn:aws:ecs:us-west-2:123456789012:capacity-provider/ExampleCapacityProvider",
"name": "ExampleCapacityProvider",
"status": "ACTIVE",
"autoScalingGroupProvider": {
"autoScalingGroupArn": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
"managedScaling": {
"status": "ENABLED",
"targetCapacity": 100,
"minimumScalingStepSize": 1,
"maximumScalingStepSize": 10000
},
"managedTerminationProtection": "DISABLED"
},
"updateStatus": "DELETE_IN_PROGRESS",
"tags": []
}
}
For more information, see Cluster capacity providers in the Amazon ECS Developer Guide.
capacityProvider -> (structure)
The details of the capacity provider.
capacityProviderArn -> (string)
The Amazon Resource Name (ARN) that identifies the capacity provider.name -> (string)
The name of the capacity provider.cluster -> (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.status -> (string)
The current status of the capacity provider. Only capacity providers in an
ACTIVE
state can be used in a cluster. When a capacity provider is successfully deleted, it has anINACTIVE
status.Possible values:
PROVISIONING
ACTIVE
DEPROVISIONING
INACTIVE
autoScalingGroupProvider -> (structure)
The Auto Scaling group settings for the capacity provider.
autoScalingGroupArn -> (string) [required]
The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.managedScaling -> (structure)
The managed scaling settings for the Auto Scaling group capacity provider.
status -> (string)
Determines whether to use managed scaling for the capacity provider.
Possible values:
ENABLED
DISABLED
targetCapacity -> (integer)
The target capacity utilization as a percentage for the capacity provider. The specified value must be greater than
0
and less than or equal to100
. For example, if you want the capacity provider to maintain 10% spare capacity, then that means the utilization is 90%, so use atargetCapacity
of90
. The default value of100
percent results in the Amazon EC2 instances in your Auto Scaling group being completely used.Constraints:
- min:
1
- max:
100
minimumScalingStepSize -> (integer)
The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time. The scale in process is not affected by this parameter If this parameter is omitted, the default value of
1
is used.When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.
Constraints:
- min:
1
- max:
10000
maximumScalingStepSize -> (integer)
The maximum number of Amazon EC2 instances that Amazon ECS will scale out at one time. If this parameter is omitted, the default value of
10000
is used.Constraints:
- min:
1
- max:
10000
instanceWarmupPeriod -> (integer)
The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group. If this parameter is omitted, the default value of
300
seconds is used.Constraints:
- min:
0
- max:
10000
managedTerminationProtection -> (string)
The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.
Warning
When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn’t work.When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see Instance Protection in the Auto Scaling User Guide .
When managed termination protection is off, your Amazon EC2 instances aren’t protected from termination when the Auto Scaling group scales in.
Possible values:
ENABLED
DISABLED
managedDraining -> (string)
The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.
Possible values:
ENABLED
DISABLED
managedInstancesProvider -> (structure)
The configuration for the Amazon ECS Managed Instances provider. This includes the infrastructure role, the launch template configuration, and tag propagation settings.
infrastructureRoleArn -> (string)
The Amazon Resource Name (ARN) of the infrastructure role that Amazon ECS assumes to manage instances. This role must include permissions for Amazon EC2 instance lifecycle management, networking, and any additional Amazon Web Services services required for your workloads.
For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide .
instanceLaunchTemplate -> (structure)
The launch template that defines how Amazon ECS launches Amazon ECS Managed Instances. This includes the instance profile for your tasks, network and storage configuration, and instance requirements that determine which Amazon EC2 instance types can be used.
For more information, see Store instance launch parameters in Amazon EC2 launch templates in the Amazon EC2 User Guide .
ec2InstanceProfileArn -> (string) [required]
The Amazon Resource Name (ARN) of the instance profile that Amazon ECS applies to Amazon ECS Managed Instances. This instance profile must include the necessary permissions for your tasks to access Amazon Web Services services and resources.
For more information, see Amazon ECS instance profile for Managed Instances in the Amazon ECS Developer Guide .
networkConfiguration -> (structure) [required]
The network configuration for Amazon ECS Managed Instances. This specifies the subnets and security groups that instances use for network connectivity.
subnets -> (list)
The list of subnet IDs where Amazon ECS can launch Amazon ECS Managed Instances. Instances are distributed across the specified subnets for high availability. All subnets must be in the same VPC.
(string)
securityGroups -> (list)
The list of security group IDs to apply to Amazon ECS Managed Instances. These security groups control the network traffic allowed to and from the instances.
(string)
storageConfiguration -> (structure)
The storage configuration for Amazon ECS Managed Instances. This defines the root volume size and type for the instances.
storageSizeGiB -> (integer)
The size of the tasks volume.
Constraints:
- min:
1
monitoring -> (string)
CloudWatch provides two categories of monitoring: basic monitoring and detailed monitoring. By default, your managed instance is configured for basic monitoring. You can optionally enable detailed monitoring to help you more quickly identify and act on operational issues. You can enable or turn off detailed monitoring at launch or when the managed instance is running or stopped. For more information, see Detailed monitoring for Amazon ECS Managed Instances in the Amazon ECS Developer Guide.
Possible values:
BASIC
DETAILED
instanceRequirements -> (structure)
The instance requirements. You can specify:
- The instance types
- Instance requirements such as vCPU count, memory, network performance, and accelerator specifications
Amazon ECS automatically selects the instances that match the specified criteria.
vCpuCount -> (structure) [required]
The minimum and maximum number of vCPUs for the instance types. Amazon ECS selects instance types that have vCPU counts within this range.
min -> (integer) [required]
The minimum number of vCPUs. Instance types with fewer vCPUs than this value are excluded from selection.max -> (integer)
The maximum number of vCPUs. Instance types with more vCPUs than this value are excluded from selection.memoryMiB -> (structure) [required]
The minimum and maximum amount of memory in mebibytes (MiB) for the instance types. Amazon ECS selects instance types that have memory within this range.
min -> (integer) [required]
The minimum amount of memory in MiB. Instance types with less memory than this value are excluded from selection.max -> (integer)
The maximum amount of memory in MiB. Instance types with more memory than this value are excluded from selection.cpuManufacturers -> (list)
The CPU manufacturers to include or exclude. You can specify
intel
,amd
, oramazon-web-services
to control which CPU types are used for your workloads.(string)
Possible values:
intel
amd
amazon-web-services
memoryGiBPerVCpu -> (structure)
The minimum and maximum amount of memory per vCPU in gibibytes (GiB). This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
min -> (double)
The minimum amount of memory per vCPU in GiB. Instance types with a lower memory-to-vCPU ratio are excluded from selection.max -> (double)
The maximum amount of memory per vCPU in GiB. Instance types with a higher memory-to-vCPU ratio are excluded from selection.excludedInstanceTypes -> (list)
The instance types to exclude from selection. Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.
Constraints:
- max:
400
(string)
Constraints:
- min:
1
- max:
30
- pattern:
[a-zA-Z0-9\.\*\-]+
instanceGenerations -> (list)
The instance generations to include. You can specify
current
to use the latest generation instances, orprevious
to include previous generation instances for cost optimization.(string)
Possible values:
current
previous
spotMaxPricePercentageOverLowestPrice -> (integer)
The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance. This helps control Spot instance costs while maintaining access to capacity.onDemandMaxPricePercentageOverLowestPrice -> (integer)
The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.bareMetal -> (string)
Indicates whether to include bare metal instance types. Set to
included
to allow bare metal instances,excluded
to exclude them, orrequired
to use only bare metal instances.Possible values:
included
required
excluded
burstablePerformance -> (string)
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to
included
to allow burstable instances,excluded
to exclude them, orrequired
to use only burstable instances.Possible values:
included
required
excluded
requireHibernateSupport -> (boolean)
Indicates whether the instance types must support hibernation. When set totrue
, only instance types that support hibernation are selected.networkInterfaceCount -> (structure)
The minimum and maximum number of network interfaces for the instance types. This is useful for workloads that require multiple network interfaces.
min -> (integer)
The minimum number of network interfaces. Instance types that support fewer network interfaces are excluded from selection.max -> (integer)
The maximum number of network interfaces. Instance types that support more network interfaces are excluded from selection.localStorage -> (string)
Indicates whether to include instance types with local storage. Set to
included
to allow local storage,excluded
to exclude it, orrequired
to use only instances with local storage.Possible values:
included
required
excluded
localStorageTypes -> (list)
The local storage types to include. You can specify
hdd
for hard disk drives,ssd
for solid state drives, or both.(string)
Possible values:
hdd
ssd
totalLocalStorageGB -> (structure)
The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
min -> (double)
The minimum total local storage in GB. Instance types with less local storage are excluded from selection.max -> (double)
The maximum total local storage in GB. Instance types with more local storage are excluded from selection.baselineEbsBandwidthMbps -> (structure)
The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps). This is important for workloads with high storage I/O requirements.
min -> (integer)
The minimum baseline Amazon EBS bandwidth in Mbps. Instance types with lower Amazon EBS bandwidth are excluded from selection.max -> (integer)
The maximum baseline Amazon EBS bandwidth in Mbps. Instance types with higher Amazon EBS bandwidth are excluded from selection.acceleratorTypes -> (list)
The accelerator types to include. You can specify
gpu
for graphics processing units,fpga
for field programmable gate arrays, orinference
for machine learning inference accelerators.(string)
Possible values:
gpu
fpga
inference
acceleratorCount -> (structure)
The minimum and maximum number of accelerators for the instance types. This is used when you need instances with specific numbers of GPUs or other accelerators.
min -> (integer)
The minimum number of accelerators. Instance types with fewer accelerators are excluded from selection.max -> (integer)
The maximum number of accelerators. Instance types with more accelerators are excluded from selection.acceleratorManufacturers -> (list)
The accelerator manufacturers to include. You can specify
nvidia
,amd
,amazon-web-services
, orxilinx
depending on your accelerator requirements.(string)
Possible values:
amazon-web-services
amd
nvidia
xilinx
habana
acceleratorNames -> (list)
The specific accelerator names to include. For example, you can specify
a100
,v100
,k80
, or other specific accelerator models.(string)
Possible values:
a100
inferentia
k520
k80
m60
radeon-pro-v520
t4
vu9p
v100
a10g
h100
t4g
acceleratorTotalMemoryMiB -> (structure)
The minimum and maximum total accelerator memory in mebibytes (MiB). This is important for GPU workloads that require specific amounts of video memory.
min -> (integer)
The minimum total accelerator memory in MiB. Instance types with less accelerator memory are excluded from selection.max -> (integer)
The maximum total accelerator memory in MiB. Instance types with more accelerator memory are excluded from selection.networkBandwidthGbps -> (structure)
The minimum and maximum network bandwidth in gigabits per second (Gbps). This is crucial for network-intensive workloads that require high throughput.
min -> (double)
The minimum network bandwidth in Gbps. Instance types with lower network bandwidth are excluded from selection.max -> (double)
The maximum network bandwidth in Gbps. Instance types with higher network bandwidth are excluded from selection.allowedInstanceTypes -> (list)
The instance types to include in the selection. When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.
Constraints:
- max:
400
(string)
Constraints:
- min:
1
- max:
30
- pattern:
[a-zA-Z0-9\.\*\-]+
maxSpotPriceAsPercentageOfOptimalOnDemandPrice -> (integer)
The maximum price for Spot instances as a percentage of the optimal On-Demand price. This provides more precise cost control for Spot instance selection.propagateTags -> (string)
Determines whether tags from the capacity provider are automatically applied to Amazon ECS Managed Instances. This helps with cost allocation and resource management by ensuring consistent tagging across your infrastructure.
Possible values:
CAPACITY_PROVIDER
NONE
updateStatus -> (string)
The update status of the capacity provider. The following are the possible states that is returned.
DELETE_IN_PROGRESSThe capacity provider is in the process of being deleted.
DELETE_COMPLETEThe capacity provider was successfully deleted and has an
INACTIVE
status.DELETE_FAILEDThe capacity provider can’t be deleted. The update status reason provides further details about why the delete failed.
Possible values:
CREATE_IN_PROGRESS
CREATE_COMPLETE
CREATE_FAILED
DELETE_IN_PROGRESS
DELETE_COMPLETE
DELETE_FAILED
UPDATE_IN_PROGRESS
UPDATE_COMPLETE
UPDATE_FAILED
updateStatusReason -> (string)
The update status reason. This provides further details about the update status for the capacity provider.tags -> (list)
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: + - = . _ : / @.
- 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.Constraints:
- min:
0
- max:
50
(structure)
The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value. You define 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.key -> (string)
One part of a key-value pair that make up a tag. A
key
is a general label that acts like a category for more specific tag values.Constraints:
- min:
1
- max:
128
- pattern:
^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
value -> (string)
The optional part of a key-value pair that make up a tag. A
value
acts as a descriptor within a tag category (key).Constraints:
- min:
0
- max:
256
- pattern:
^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
type -> (string)
The type of capacity provider. For Amazon ECS Managed Instances, this value is
MANAGED_INSTANCES
, indicating that Amazon ECS manages the underlying Amazon EC2 instances on your behalf.Possible values:
EC2_AUTOSCALING
MANAGED_INSTANCES
FARGATE
FARGATE_SPOT