Skip to content

describe_instance_type_offerings

describe_instance_type_offerings(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    location_type: Optional[LocationType] = None,
    filters: Optional[FilterList] = None,
    max_results: Optional[DITOMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeInstanceTypeOfferingsResult

Lists the instance types that are offered for the specified location. If no location is specified, the default is to list the instance types that are offered in the current Region.

Parameters:

  • 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.

  • location_type (Optional[LocationType], default: None ) –

    The location type.

    • availability-zone - The Availability Zone. When you specify a location filter, it must be an Availability Zone for the current Region.

    • availability-zone-id - The AZ ID. When you specify a location filter, it must be an AZ ID for the current Region.

    • outpost - The Outpost ARN. When you specify a location filter, it must be an Outpost ARN for the current Region.

    • region - The current Region. If you specify a location filter, it must match the current Region.

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

    One or more filters. Filter names and values are case-sensitive.

    • instance-type - The instance type. For a list of possible values, see Instance.

    • location - The location. For a list of possible identifiers, see Regions and Zones.

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

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

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

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def describe_instance_type_offerings(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    location_type: Optional["capo_ec2.types.location_type.LocationType"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    max_results: Optional["capo_ec2.types.dito_max_results.DITOMaxResults"] = None,
    next_token: Optional["capo_ec2.types.next_token.NextToken"] = None,
) -> "capo_ec2.types.describe_instance_type_offerings_result.DescribeInstanceTypeOfferingsResult":
    """<p>Lists the instance types that are offered for the specified location. If no location is specified, the default is to list the instance types that are offered in the current Region.</p>

    Args:
        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>
        location_type: <p>The location type.</p> <ul> <li> <p> <code>availability-zone</code> - The Availability Zone. When you specify a location filter, it must be an Availability Zone for the current Region.</p> </li> <li> <p> <code>availability-zone-id</code> - The AZ ID. When you specify a location filter, it must be an AZ ID for the current Region.</p> </li> <li> <p> <code>outpost</code> - The Outpost ARN. When you specify a location filter, it must be an Outpost ARN for the current Region.</p> </li> <li> <p> <code>region</code> - The current Region. If you specify a location filter, it must match the current Region.</p> </li> </ul>
        filters: <p>One or more filters. Filter names and values are case-sensitive.</p> <ul> <li> <p> <code>instance-type</code> - The instance type. For a list of possible values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html">Instance</a>.</p> </li> <li> <p> <code>location</code> - The location. For a list of possible identifiers, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html">Regions and Zones</a>.</p> </li> </ul>
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</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_instance_type_offerings_request.DescribeInstanceTypeOfferingsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_instance_type_offerings_result.DescribeInstanceTypeOfferingsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_instance_type_offerings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceTypeOfferings")
    )
    input_: capo_ec2.types.describe_instance_type_offerings_request.DescribeInstanceTypeOfferingsRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if location_type is not None:
        input_["location_type"] = location_type
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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