delete_fleets¶
Operation¶
delete_fleets
async
¶
delete_fleets(input: DeleteFleetsInput, plugins: list[Plugin] | None = None) -> DeleteFleetsOutput
Deletes the specified EC2 Fleet request.
After you delete an EC2 Fleet request, it launches no new instances.
You must also specify whether a deleted EC2 Fleet request should
terminate its instances. If you choose to terminate the instances, the
EC2 Fleet request enters the deleted_terminating state. Otherwise, it
enters the deleted_running state, and the instances continue to run
until they are interrupted or you terminate them manually.
A deleted instant fleet with running instances is not supported. When
you delete an instant fleet, Amazon EC2 automatically terminates all
its instances. For fleets with more than 1000 instances, the deletion
request might fail. If your fleet has more than 1000 instances, first
terminate most of the instances manually, leaving 1000 or fewer. Then
delete the fleet, and the remaining instances will be terminated
automatically.
Warning
Terminating an instance is permanent and irreversible.
After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see How instance termination works.
Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage.
Restrictions
-
You can delete up to 25 fleets of type
instantin a single request. -
You can delete up to 100 fleets of type
maintainorrequestin a single request. -
You can delete up to 125 fleets in a single request, provided you do not exceed the quota for each fleet type, as specified above.
-
If you exceed the specified number of fleets to delete, no fleets are deleted.
For more information, see Delete an EC2 Fleet request and the instances in the fleet in the Amazon EC2 User Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
DeleteFleetsInput
|
An instance of |
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 |
|---|---|
DeleteFleetsOutput
|
An instance of |
Input¶
DeleteFleetsInput
dataclass
¶
Bases: _SerdeShape
Dataclass for DeleteFleetsInput structure.
Attributes¶
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | None = ...
Checks whether you have the required permissions for the action, without
actually making the request, and provides an error response. If you have
the required permissions, the error response is DryRunOperation.
Otherwise, it is UnauthorizedOperation.
fleet_ids
class-attribute
instance-attribute
¶
The IDs of the EC2 Fleets.
Constraints: In a single request, you can specify up to 25 instant
fleet IDs and up to 100 maintain or request fleet IDs.
terminate_instances
class-attribute
instance-attribute
¶
terminate_instances: bool | None = ...
Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.
To let the instances continue to run after the EC2 Fleet is deleted,
specify no-terminate-instances. Supported only for fleets of type
maintain and request.
For instant fleets, you cannot specify NoTerminateInstances. A
deleted instant fleet with running instances is not supported.
Output¶
DeleteFleetsOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for DeleteFleetsOutput structure.
Attributes¶
response_metadata
class-attribute
instance-attribute
¶
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.