modify_db_capacity_reservation
¶
modify_db_capacity_reservation(
*,
config_overrides: Optional[RDSClientConfig] = 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.
>>> 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/rds.py
10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 | |