Skip to content

ECS  >  Operations  >  delete_capacity_provider

delete_capacity_provider

Operation

delete_capacity_provider async

delete_capacity_provider(input: DeleteCapacityProviderInput, plugins: list[Plugin] | None = None) -> DeleteCapacityProviderOutput

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 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:

Name Type Description Default
input DeleteCapacityProviderInput

An instance of DeleteCapacityProviderInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
DeleteCapacityProviderOutput

An instance of DeleteCapacityProviderOutput.

Input

DeleteCapacityProviderInput dataclass

Bases: _SerdeShape

Dataclass for DeleteCapacityProviderInput structure.

Attributes

capacity_provider class-attribute instance-attribute
capacity_provider: str | None = ...

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

cluster class-attribute instance-attribute
cluster: str | None = ...

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.

Output

DeleteCapacityProviderOutput dataclass

Bases: _SerdeShape

Dataclass for DeleteCapacityProviderOutput structure.

Attributes

capacity_provider class-attribute instance-attribute
capacity_provider: CapacityProvider | None = ...

The details of the capacity provider.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.