modify_db_capacity_reservation
async
¶
modify_db_capacity_reservation(
*,
config_overrides: Optional[AsyncRDSClientConfig] = None,
db_capacity_reservation_identifier: Optional[
DBCapacityReservationIdentifier
] = None,
capacity_per_availability_zone: Optional[IntegerOptional] = None,
end_date_type: Optional[EndDateType] = None,
end_date: Optional[TStamp] = None,
) -> ModifyDBCapacityReservationResponse
Modifies a DB capacity reservation. You can change the reserved capacity in each Availability Zone of the reservation, and you can change the end date of the reservation. You can't change the Availability Zones of an existing reservation.
The reservation must be in the active state. A future-dated reservation that hasn't started isn't modifiable, and neither is a reservation that Amazon RDS is already modifying.
You must specify CapacityPerAvailabilityZone, EndDateType, or EndDate. A request that specifies none of the three changes nothing, and Amazon RDS rejects it.
Parameters:
-
db_capacity_reservation_identifier(Optional[DBCapacityReservationIdentifier], default:None) –The identifier or the name of the DB capacity reservation to modify. You can specify the identifier, which has the prefix
dbcr-, or the reservation name. -
capacity_per_availability_zone(Optional[IntegerOptional], default:None) –The new number of DB instances to reserve in each Availability Zone of the reservation. Amazon RDS applies this number to every Availability Zone of the reservation.
An increase reserves more capacity at the time of the request, so it can fail when the Amazon Web Services Region has insufficient capacity.
This value multiplied by the number of Availability Zones counts against the DB instances quota for your Amazon Web Services account in the Amazon Web Services Region. Amazon RDS checks the quota only when you increase the value.
Constraints:
-
Minimum 1.
-
Can't be less than the highest number of DB instances that use the reservation in any single Availability Zone of the reservation. That number includes a DB instance that holds a unit of reserved capacity for a pending modification. To find that number for an Availability Zone, subtract
AvailableCapacityfromReservedCapacityPerAvailabilityZone. -
During a capacity commitment, can't be less than
CommittedCapacityPerAvailabilityZone.
-
-
end_date_type(Optional[EndDateType], default:None) –The end date type for the reservation.
Valid Values:
-
limited- The reservation has a specific end date. You must also specifyEndDate. -
unlimited- The reservation doesn't expire. Don't specifyEndDate.
-
-
end_date(Optional[TStamp], default:None) –The new end date for the reservation, in Universal Coordinated Time (UTC). Required when
EndDateTypeislimited. Don't specify a value whenEndDateTypeisunlimited.When you specify
EndDate, you must also specifyEndDateType.Constraints:
-
Must be a date and time in the future.
-
During a capacity commitment, must be at or after
CommitmentEndDate.
-
Raises:
-
DBCapacityReservationNotFoundFault–DBCapacityReservationIdentifierdoesn't refer to an existing DB capacity reservation. -
InstanceQuotaExceededFault–The request would result in the user exceeding the allowed number of DB instances.
-
InsufficientDBInstanceCapacityFault–The specified DB instance class isn't available in the specified Availability Zone.
-
InvalidDBCapacityReservationStateFault–The DB capacity reservation isn't in a valid state.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To change the capacity and the end date of a DB capacity reservation The following example raises the reserved capacity to three DB instances in each Availability Zone of the reservation, and it sets an end date. Set EndDateType to limited to give the reservation an end date. Set EndDateType to unlimited to remove the end date, and specify no EndDate. Amazon RDS applies the modification asynchronously, and it moves the reservation to the pending state. Call DescribeDBCapacityReservations to check when the reservation returns to the active state with the new capacity.
>>> await client.modify_db_capacity_reservation(db_capacity_reservation_identifier='dbcr-7hqk2m9xv4t1bn6cz3ws8dj5fp0gyr2a', capacity_per_availability_zone=3, end_date_type='limited', end_date='2026-12-31T23:59:59Z')
Source code in docs_src/capo_rds/_services/async_rds.py
10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 | |