Skip to content

RDS  >  Operations  >  stop_db_instance

stop_db_instance

Operation

stop_db_instance async

stop_db_instance(input: StopDBInstanceInput, plugins: list[Plugin] | None = None) -> StopDBInstanceOutput

Stops an Amazon RDS DB instance temporarily. When you stop a DB instance, Amazon RDS retains the DB instance's metadata, including its endpoint, DB parameter group, and option group membership. Amazon RDS also retains the transaction logs so you can do a point-in-time restore if necessary. The instance restarts automatically after 7 days.

For more information, see Stopping an Amazon RDS DB Instance Temporarily in the Amazon RDS User Guide.

Note

This command doesn't apply to RDS Custom, Aurora MySQL, and Aurora PostgreSQL. For Aurora clusters, use StopDBCluster instead.

Parameters:

Name Type Description Default
input StopDBInstanceInput

An instance of StopDBInstanceInput.

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
StopDBInstanceOutput

An instance of StopDBInstanceOutput.

Input

StopDBInstanceInput dataclass

Bases: _SerdeShape

Dataclass for StopDBInstanceInput structure.

Attributes

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

The user-supplied instance identifier.

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

The user-supplied instance identifier of the DB Snapshot created immediately before the DB instance is stopped.

detach_from_db_capacity_reservation class-attribute instance-attribute
detach_from_db_capacity_reservation: bool | None = ...

Specifies whether the DB instance stops using its DB capacity reservation when the DB instance stops. When you specify true, the DB instance belongs to no reservation after it stops, and a later start launches it outside the reservation.

By default, a stopped DB instance keeps its DB capacity reservation, and a later start returns the DB instance to the same reservation.

Every stop releases the unit of reserved capacity that the DB instance holds, for either value of this parameter. Another DB instance can then use that capacity. This parameter controls the reservation that the DB instance belongs to, and it does not control the release of the capacity.

If the DB instance uses no DB capacity reservation, this parameter has no effect.

Warning

Amazon RDS holds no capacity for a stopped DB instance. When the reservation has no available capacity in the Availability Zone of the DB instance, a later start waits for capacity in that Availability Zone. When the DB instance belongs to no reservation, a later start can fail because the Amazon Web Services Region has insufficient capacity for the DB instance class.

Output

StopDBInstanceOutput dataclass

Bases: _SerdeShape

Dataclass for StopDBInstanceOutput structure.

Attributes

db_instance class-attribute instance-attribute
db_instance: DBInstance | None = ...

Contains the details of an Amazon RDS DB instance.

This data type is used as a response element in the operations CreateDBInstance, CreateDBInstanceReadReplica, DeleteDBInstance, DescribeDBInstances, ModifyDBInstance, PromoteReadReplica, RebootDBInstance, RestoreDBInstanceFromDBSnapshot, RestoreDBInstanceFromS3, RestoreDBInstanceToPointInTime, StartDBInstance, and StopDBInstance.

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.