Skip to content

EC2  >  Operations  >  release_hosts

release_hosts

Operation

release_hosts async

release_hosts(input: ReleaseHostsInput, plugins: list[Plugin] | None = None) -> ReleaseHostsOutput

When you no longer want to use an On-Demand Dedicated Host it can be released. On-Demand billing is stopped and the host goes into released state. The host ID of Dedicated Hosts that have been released can no longer be specified in another request, for example, to modify the host. You must stop or terminate all instances on a host before it can be released.

When Dedicated Hosts are released, it may take some time for them to stop counting toward your limit and you may receive capacity errors when trying to allocate new Dedicated Hosts. Wait a few minutes and then try again.

Released hosts still appear in a DescribeHosts response.

Parameters:

Name Type Description Default
input ReleaseHostsInput

An instance of ReleaseHostsInput.

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
ReleaseHostsOutput

An instance of ReleaseHostsOutput.

Input

ReleaseHostsInput dataclass

Bases: _SerdeShape

Dataclass for ReleaseHostsInput structure.

Attributes

host_ids class-attribute instance-attribute
host_ids: list[str] | None = ...

The IDs of the Dedicated Hosts to release.

Output

ReleaseHostsOutput dataclass

Bases: _SerdeShape

Dataclass for ReleaseHostsOutput structure.

Attributes

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.

successful class-attribute instance-attribute
successful: list[str] | None = ...

The IDs of the Dedicated Hosts that were successfully released.

unsuccessful class-attribute instance-attribute
unsuccessful: list[UnsuccessfulItem] | None = ...

The IDs of the Dedicated Hosts that could not be released, including an error message.