DeleteCapacityProvider - Amazon Elastic Container Service

DeleteCapacityProvider

Deletes the specified capacity provider.

Note

The FARGATE and FARGATE_SPOT capacity providers are reserved and can't be deleted. You can disassociate them from a cluster using either the PutClusterCapacityProviders API 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.

Request Syntax

{ "capacityProvider": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

capacityProvider

The short name or full Amazon Resource Name (ARN) of the capacity provider to delete.

Type: String

Required: Yes

Response Syntax

{ "capacityProvider": { "autoScalingGroupProvider": { "autoScalingGroupArn": "string", "managedDraining": "string", "managedScaling": { "instanceWarmupPeriod": number, "maximumScalingStepSize": number, "minimumScalingStepSize": number, "status": "string", "targetCapacity": number }, "managedTerminationProtection": "string" }, "capacityProviderArn": "string", "name": "string", "status": "string", "tags": [ { "key": "string", "value": "string" } ], "updateStatus": "string", "updateStatusReason": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

capacityProvider

The details of the capacity provider.

Type: CapacityProvider object

Errors

For information about the errors that are common to all actions, see Common Errors.

ClientException

These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.

HTTP Status Code: 400

InvalidParameterException

The specified parameter isn't valid. Review the available parameters for the API request.

HTTP Status Code: 400

ServerException

These errors are usually caused by a server issue.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: