RDS / Client / purchase_reserved_db_instances_offering

purchase_reserved_db_instances_offering#

RDS.Client.purchase_reserved_db_instances_offering(**kwargs)#

Purchases a reserved DB instance offering.

See also: AWS API Documentation

Request Syntax

response = client.purchase_reserved_db_instances_offering(
    ReservedDBInstancesOfferingId='string',
    ReservedDBInstanceId='string',
    DBInstanceCount=123,
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • ReservedDBInstancesOfferingId (string) –

    [REQUIRED]

    The ID of the Reserved DB instance offering to purchase.

    Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706

  • ReservedDBInstanceId (string) –

    Customer-specified identifier to track this reservation.

    Example: myreservationID

  • DBInstanceCount (integer) –

    The number of instances to reserve.

    Default: 1

  • Tags (list) –

    A list of tags.

    For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide.

    • (dict) –

      Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

      For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide.

      • Key (string) –

        A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can’t be prefixed with aws: or rds:. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘:’, ‘/’, ‘=’, ‘+’, ‘-’, ‘@’ (Java regex: “^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$”).

      • Value (string) –

        A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can’t be prefixed with aws: or rds:. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘:’, ‘/’, ‘=’, ‘+’, ‘-’, ‘@’ (Java regex: “^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$”).

Return type:

dict

Returns:

Response Syntax

{
    'ReservedDBInstance': {
        'ReservedDBInstanceId': 'string',
        'ReservedDBInstancesOfferingId': 'string',
        'DBInstanceClass': 'string',
        'StartTime': datetime(2015, 1, 1),
        'Duration': 123,
        'FixedPrice': 123.0,
        'UsagePrice': 123.0,
        'CurrencyCode': 'string',
        'DBInstanceCount': 123,
        'ProductDescription': 'string',
        'OfferingType': 'string',
        'MultiAZ': True|False,
        'State': 'string',
        'RecurringCharges': [
            {
                'RecurringChargeAmount': 123.0,
                'RecurringChargeFrequency': 'string'
            },
        ],
        'ReservedDBInstanceArn': 'string',
        'LeaseId': 'string'
    }
}

Response Structure

  • (dict) –

    • ReservedDBInstance (dict) –

      This data type is used as a response element in the DescribeReservedDBInstances and PurchaseReservedDBInstancesOffering actions.

      • ReservedDBInstanceId (string) –

        The unique identifier for the reservation.

      • ReservedDBInstancesOfferingId (string) –

        The offering identifier.

      • DBInstanceClass (string) –

        The DB instance class for the reserved DB instance.

      • StartTime (datetime) –

        The time the reservation started.

      • Duration (integer) –

        The duration of the reservation in seconds.

      • FixedPrice (float) –

        The fixed price charged for this reserved DB instance.

      • UsagePrice (float) –

        The hourly price charged for this reserved DB instance.

      • CurrencyCode (string) –

        The currency code for the reserved DB instance.

      • DBInstanceCount (integer) –

        The number of reserved DB instances.

      • ProductDescription (string) –

        The description of the reserved DB instance.

      • OfferingType (string) –

        The offering type of this reserved DB instance.

      • MultiAZ (boolean) –

        Indicates whether the reservation applies to Multi-AZ deployments.

      • State (string) –

        The state of the reserved DB instance.

      • RecurringCharges (list) –

        The recurring price charged to run this reserved DB instance.

        • (dict) –

          This data type is used as a response element in the DescribeReservedDBInstances and DescribeReservedDBInstancesOfferings actions.

          • RecurringChargeAmount (float) –

            The amount of the recurring charge.

          • RecurringChargeFrequency (string) –

            The frequency of the recurring charge.

      • ReservedDBInstanceArn (string) –

        The Amazon Resource Name (ARN) for the reserved DB instance.

      • LeaseId (string) –

        The unique identifier for the lease associated with the reserved DB instance.

        Note

        Amazon Web Services Support might request the lease ID for an issue related to a reserved DB instance.

Exceptions

Examples

This example purchases a reserved DB instance offering that matches the specified settings.

response = client.purchase_reserved_db_instances_offering(
    ReservedDBInstanceId='myreservationid',
    ReservedDBInstancesOfferingId='fb29428a-646d-4390-850e-5fe89926e727',
)

print(response)

Expected Output:

{
    'ReservedDBInstance': {
    },
    'ResponseMetadata': {
        '...': '...',
    },
}