Table: aws_api_gateway_usage_plan - Query AWS API Gateway Usage Plans using SQL
The AWS API Gateway Usage Plans are a feature of Amazon API Gateway that allows developers to manage and restrict the usage of their APIs. These plans can be associated with API keys to enable cost recovery, as well as to control the usage of APIs by third-party developers. This ensures a smooth and controlled distribution of your APIs, protecting them from misuse and overuse.
Table Usage Guide
The aws_api_gateway_usage_plan
table in Steampipe provides you with information about usage plans within AWS API Gateway. This table allows you, as a DevOps engineer, to query usage plan specific details, including associated API stages, throttle and quota limits, and associated metadata. You can utilize this table to gather insights on usage plans, such as plans with specific rate limits, the number of requests your clients can make per a given period, and more. The schema outlines the various attributes of the usage plan, including the plan ID, name, description, associated API keys, and associated tags for you.
Examples
Basic info
Explore the various usage plans associated with your AWS API Gateway. This can help you better manage and monitor your API usage, ensuring optimal performance and cost-effectiveness.
select name, id, product_code, description, api_stagesfrom aws_api_gateway_usage_plan;
select name, id, product_code, description, api_stagesfrom aws_api_gateway_usage_plan;
List the API gateway usage plans where quota ( i.e the number of api call a user can make within a time period) is disabled
Identify instances where the API gateway usage plans do not have a set quota, which indicates that there is no limit to the number of API calls a user can make within a certain time period. This might be useful in understanding potential areas of vulnerability or overuse in your system.
select name, id, quotafrom aws_api_gateway_usage_planwhere quota is null;
select name, id, quotafrom aws_api_gateway_usage_planwhere quota is null;
List the API gateway usage plan where throttle ( i.e the rate at which user can make request ) is disabled
Determine the areas in which the API gateway usage plan lacks a throttle feature, indicating that there are no restrictions on user request rates.
select name, id, throttlefrom aws_api_gateway_usage_planwhere throttle is null;
select name, id, throttlefrom aws_api_gateway_usage_planwhere throttle is null;
Schema for aws_api_gateway_usage_plan
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
api_stages | jsonb | The associated API stages of a usage plan | |
description | text | The description of a usage plan | |
id | text | = | The identifier of a UsagePlan resource |
name | text | The name of a usage plan | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
product_code | text | The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace | |
quota | jsonb | The maximum number of permitted requests per a given unit time interval | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
throttle | jsonb | The request throttle limits of a usage plan | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_api_gateway_usage_plan