AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) 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.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to DeleteCapacityProviderAsync.

Namespace: Amazon.ECS
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z

Syntax

C#
public virtual DeleteCapacityProviderResponse DeleteCapacityProvider(
         DeleteCapacityProviderRequest request
)

Parameters

request
Type: Amazon.ECS.Model.DeleteCapacityProviderRequest

Container for the necessary parameters to execute the DeleteCapacityProvider service method.

Return Value


The response from the DeleteCapacityProvider service method, as returned by ECS.

Exceptions

ExceptionCondition
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.
InvalidParameterException The specified parameter isn't valid. Review the available parameters for the API request. For more information about service event errors, see Amazon ECS service event messages.
ServerException These errors are usually caused by a server issue.

Examples

This example deletes a specified capacity provider.

To delete a specified capacity provider


var client = new AmazonECSClient();
var response = client.DeleteCapacityProvider(new DeleteCapacityProviderRequest 
{
    CapacityProvider = "arn:aws:ecs:us-west-2:123456789012:capacity-provider/ExampleCapacityProvider"
});

CapacityProvider capacityProvider = response.CapacityProvider;

            

Version Information

.NET Framework:
Supported in: 4.5 and newer, 3.5

See Also