Skip to content

describe_reserved_instances_offerings

describe_reserved_instances_offerings(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    availability_zone: Optional[String] = None,
    include_marketplace: Optional[Boolean] = None,
    instance_type: Optional[InstanceType] = None,
    max_duration: Optional[Long] = None,
    max_instance_count: Optional[Integer] = None,
    min_duration: Optional[Long] = None,
    offering_class: Optional[OfferingClassType] = None,
    product_description: Optional[RIProductDescription] = None,
    reserved_instances_offering_ids: Optional[
        ReservedInstancesOfferingIdStringList
    ] = None,
    availability_zone_id: Optional[AvailabilityZoneId] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
    instance_tenancy: Optional[Tenancy] = None,
    offering_type: Optional[OfferingTypeValues] = None,
    next_token: Optional[String] = None,
    max_results: Optional[Integer] = None,
) -> DescribeReservedInstancesOfferingsResult

Describes Reserved Instance offerings that are available for purchase. With Reserved Instances, you purchase the right to launch instances for a period of time. During that time period, you do not receive insufficient capacity errors, and you pay a lower usage rate than the rate charged for On-Demand instances for the actual time used.

If you have listed your own Reserved Instances for sale in the Reserved Instance Marketplace, they will be excluded from these results. This is to ensure that you do not purchase your own Reserved Instances.

For more information, see Sell in the Reserved Instance Marketplace in the Amazon EC2 User Guide.

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

Parameters:

  • availability_zone (Optional[String], default: None ) –

    The Availability Zone in which the Reserved Instance can be used.

    Either AvailabilityZone or AvailabilityZoneId can be specified, but not both.

  • include_marketplace (Optional[Boolean], default: None ) –

    Include Reserved Instance Marketplace offerings in the response.

  • instance_type (Optional[InstanceType], default: None ) –

    The instance type that the reservation will cover (for example, m1.small). For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide.

  • max_duration (Optional[Long], default: None ) –

    The maximum duration (in seconds) to filter when searching for offerings.

    Default: 94608000 (3 years)

  • max_instance_count (Optional[Integer], default: None ) –

    The maximum number of instances to filter when searching for offerings.

    Default: 20

  • min_duration (Optional[Long], default: None ) –

    The minimum duration (in seconds) to filter when searching for offerings.

    Default: 2592000 (1 month)

  • offering_class (Optional[OfferingClassType], default: None ) –

    The offering class of the Reserved Instance. Can be standard or convertible.

  • product_description (Optional[RIProductDescription], default: None ) –

    The Reserved Instance product platform description. Instances that include (Amazon VPC) in the description are for use with Amazon VPC.

  • reserved_instances_offering_ids (Optional[ReservedInstancesOfferingIdStringList], default: None ) –

    One or more Reserved Instances offering IDs.

  • availability_zone_id (Optional[AvailabilityZoneId], default: None ) –

    The ID of the Availability Zone.

    Either AvailabilityZone or AvailabilityZoneId can be specified, but not both.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • filters (Optional[FilterList], default: None ) –

    One or more filters.

    • availability-zone - The Availability Zone where the Reserved Instance can be used.

    • availability-zone-id - The ID of the Availability Zone where the Reserved Instance can be used.

    • duration - The duration of the Reserved Instance (for example, one year or three years), in seconds (31536000 | 94608000).

    • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

    • instance-type - The instance type that is covered by the reservation.

    • marketplace - Set to true to show only Reserved Instance Marketplace offerings. When this filter is not used, which is the default behavior, all offerings from both Amazon Web Services and the Reserved Instance Marketplace are listed.

    • product-description - The Reserved Instance product platform description (Linux/UNIX | Linux with SQL Server Standard | Linux with SQL Server Web | Linux with SQL Server Enterprise | SUSE Linux | Red Hat Enterprise Linux | Red Hat Enterprise Linux with HA | Windows | Windows with SQL Server Standard | Windows with SQL Server Web | Windows with SQL Server Enterprise).

    • reserved-instances-offering-id - The Reserved Instances offering ID.

    • scope - The scope of the Reserved Instance (Availability Zone or Region).

    • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

  • instance_tenancy (Optional[Tenancy], default: None ) –

    The tenancy of the instances covered by the reservation. A Reserved Instance with a tenancy of dedicated is applied to instances that run in a VPC on single-tenant hardware (i.e., Dedicated Instances).

    Important: The host value cannot be used with this parameter. Use the default or dedicated values only.

    Default: default

  • offering_type (Optional[OfferingTypeValues], default: None ) –

    The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

  • next_token (Optional[String], default: None ) –

    The token to retrieve the next page of results.

  • max_results (Optional[Integer], default: None ) –

    The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. The maximum is 100.

    Default: 100

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def describe_reserved_instances_offerings(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    availability_zone: Optional["capo_ec2.types.string.String"] = None,
    include_marketplace: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_type: Optional["capo_ec2.types.instance_type.InstanceType"] = None,
    max_duration: Optional["capo_ec2.types.long.Long"] = None,
    max_instance_count: Optional["capo_ec2.types.integer.Integer"] = None,
    min_duration: Optional["capo_ec2.types.long.Long"] = None,
    offering_class: Optional[
        "capo_ec2.types.offering_class_type.OfferingClassType"
    ] = None,
    product_description: Optional[
        "capo_ec2.types.ri_product_description.RIProductDescription"
    ] = None,
    reserved_instances_offering_ids: Optional[
        "capo_ec2.types.reserved_instances_offering_id_string_list.ReservedInstancesOfferingIdStringList"
    ] = None,
    availability_zone_id: Optional[
        "capo_ec2.types.availability_zone_id.AvailabilityZoneId"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    instance_tenancy: Optional["capo_ec2.types.tenancy.Tenancy"] = None,
    offering_type: Optional[
        "capo_ec2.types.offering_type_values.OfferingTypeValues"
    ] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional["capo_ec2.types.integer.Integer"] = None,
) -> "capo_ec2.types.describe_reserved_instances_offerings_result.DescribeReservedInstancesOfferingsResult":
    """<p>Describes Reserved Instance offerings that are available for purchase. With Reserved Instances, you purchase the right to launch instances for a period of time. During that time period, you do not receive insufficient capacity errors, and you pay a lower usage rate than the rate charged for On-Demand instances for the actual time used.</p> <p>If you have listed your own Reserved Instances for sale in the Reserved Instance Marketplace, they will be excluded from these results. This is to ensure that you do not purchase your own Reserved Instances.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html">Sell in the Reserved Instance Marketplace</a> in the <i>Amazon EC2 User Guide</i>.</p> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>

    Args:
        availability_zone: <p>The Availability Zone in which the Reserved Instance can be used.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> can be specified, but not both.</p>
        include_marketplace: <p>Include Reserved Instance Marketplace offerings in the response.</p>
        instance_type: <p>The instance type that the reservation will cover (for example, <code>m1.small</code>). For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Amazon EC2 instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
        max_duration: <p>The maximum duration (in seconds) to filter when searching for offerings.</p> <p>Default: 94608000 (3 years)</p>
        max_instance_count: <p>The maximum number of instances to filter when searching for offerings.</p> <p>Default: 20</p>
        min_duration: <p>The minimum duration (in seconds) to filter when searching for offerings.</p> <p>Default: 2592000 (1 month)</p>
        offering_class: <p>The offering class of the Reserved Instance. Can be <code>standard</code> or <code>convertible</code>.</p>
        product_description: <p>The Reserved Instance product platform description. Instances that include <code>(Amazon VPC)</code> in the description are for use with Amazon VPC.</p>
        reserved_instances_offering_ids: <p>One or more Reserved Instances offering IDs.</p>
        availability_zone_id: <p>The ID of the Availability Zone.</p> <p>Either <code>AvailabilityZone</code> or <code>AvailabilityZoneId</code> can be specified, but not both.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>availability-zone</code> - The Availability Zone where the Reserved Instance can be used.</p> </li> <li> <p> <code>availability-zone-id</code> - The ID of the Availability Zone where the Reserved Instance can be used.</p> </li> <li> <p> <code>duration</code> - The duration of the Reserved Instance (for example, one year or three years), in seconds (<code>31536000</code> | <code>94608000</code>).</p> </li> <li> <p> <code>fixed-price</code> - The purchase price of the Reserved Instance (for example, 9800.0).</p> </li> <li> <p> <code>instance-type</code> - The instance type that is covered by the reservation.</p> </li> <li> <p> <code>marketplace</code> - Set to <code>true</code> to show only Reserved Instance Marketplace offerings. When this filter is not used, which is the default behavior, all offerings from both Amazon Web Services and the Reserved Instance Marketplace are listed.</p> </li> <li> <p> <code>product-description</code> - The Reserved Instance product platform description (<code>Linux/UNIX</code> | <code>Linux with SQL Server Standard</code> | <code>Linux with SQL Server Web</code> | <code>Linux with SQL Server Enterprise</code> | <code>SUSE Linux</code> | <code>Red Hat Enterprise Linux</code> | <code>Red Hat Enterprise Linux with HA</code> | <code>Windows</code> | <code>Windows with SQL Server Standard</code> | <code>Windows with SQL Server Web</code> | <code>Windows with SQL Server Enterprise</code>).</p> </li> <li> <p> <code>reserved-instances-offering-id</code> - The Reserved Instances offering ID.</p> </li> <li> <p> <code>scope</code> - The scope of the Reserved Instance (<code>Availability Zone</code> or <code>Region</code>).</p> </li> <li> <p> <code>usage-price</code> - The usage price of the Reserved Instance, per hour (for example, 0.84).</p> </li> </ul>
        instance_tenancy: <p>The tenancy of the instances covered by the reservation. A Reserved Instance with a tenancy of <code>dedicated</code> is applied to instances that run in a VPC on single-tenant hardware (i.e., Dedicated Instances).</p> <p> <b>Important:</b> The <code>host</code> value cannot be used with this parameter. Use the <code>default</code> or <code>dedicated</code> values only.</p> <p>Default: <code>default</code> </p>
        offering_type: <p>The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the <code>Medium Utilization</code> Reserved Instance offering type. </p>
        next_token: <p>The token to retrieve the next page of results.</p>
        max_results: <p>The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned <code>NextToken</code> value. The maximum is 100.</p> <p>Default: 100</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_reserved_instances_offerings_request.DescribeReservedInstancesOfferingsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_reserved_instances_offerings_result.DescribeReservedInstancesOfferingsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_reserved_instances_offerings

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_reserved_instances_offerings.describe_reserved_instances_offerings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeReservedInstancesOfferings")
    )
    input_: capo_ec2.types.describe_reserved_instances_offerings_request.DescribeReservedInstancesOfferingsRequest = {}
    if availability_zone is not None:
        input_["availability_zone"] = availability_zone
    if include_marketplace is not None:
        input_["include_marketplace"] = include_marketplace
    if instance_type is not None:
        input_["instance_type"] = instance_type
    if max_duration is not None:
        input_["max_duration"] = max_duration
    if max_instance_count is not None:
        input_["max_instance_count"] = max_instance_count
    if min_duration is not None:
        input_["min_duration"] = min_duration
    if offering_class is not None:
        input_["offering_class"] = offering_class
    if product_description is not None:
        input_["product_description"] = product_description
    if reserved_instances_offering_ids is not None:
        input_["reserved_instances_offering_ids"] = reserved_instances_offering_ids
    if availability_zone_id is not None:
        input_["availability_zone_id"] = availability_zone_id
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if filters is not None:
        input_["filters"] = filters
    if instance_tenancy is not None:
        input_["instance_tenancy"] = instance_tenancy
    if offering_type is not None:
        input_["offering_type"] = offering_type
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output