stop_db_instance
¶
stop_db_instance(
*,
config_overrides: Optional[RDSClientConfig] = 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/rds.py
16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 | |