stop_db_instance
async
¶
stop_db_instance(
*,
config_overrides: Optional[AsyncRDSClientConfig] = None,
db_instance_identifier: Optional[String] = None,
db_snapshot_identifier: Optional[String] = None,
detach_from_db_capacity_reservation: Optional[BooleanOptional] = None,
) -> StopDBInstanceResult
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.
This command doesn't apply to RDS Custom, Aurora MySQL, and Aurora PostgreSQL. For Aurora clusters, use StopDBCluster instead.
Parameters:
-
db_instance_identifier(Optional[String], default:None) –The user-supplied instance identifier.
-
db_snapshot_identifier(Optional[String], default:None) –The user-supplied instance identifier of the DB Snapshot created immediately before the DB instance is stopped.
-
detach_from_db_capacity_reservation(Optional[BooleanOptional], default: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.
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.
Raises:
-
DBInstanceNotFoundFault–DBInstanceIdentifierdoesn't refer to an existing DB instance. -
DBSnapshotAlreadyExistsFault–DBSnapshotIdentifieris already used by an existing snapshot. -
InvalidDBCapacityReservationStateFault–The DB capacity reservation isn't in a valid state.
-
InvalidDBClusterStateFault–The requested operation can't be performed while the cluster is in this state.
-
InvalidDBInstanceStateFault–The DB instance isn't in a valid state.
-
SnapshotQuotaExceededFault–The request would result in the user exceeding the allowed number of DB snapshots.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To stop a DB instance The following example stops the specified DB instance.
Source code in docs_src/capo_rds/_services/async_rds.py
16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 | |