steampipe plugin install aws

Table: aws_api_gatewayv2_stage - Query AWS API Gateway Stages using SQL

The AWS API Gateway Stage is a crucial component within the AWS API Gateway service. It represents a phase in the lifecycle of an API (like development, production, or beta) that an application developer interacts with. Stages are accompanied by a stage name, deployment identifier, and a description, and they allow for the routing of incoming API calls to various backend endpoints.

Table Usage Guide

The aws_api_gatewayv2_stage table in Steampipe provides you with information about stages within AWS API Gateway. This table allows you, as a DevOps engineer, to query stage-specific details, including default route settings, deployment ID, description, and associated metadata. You can utilize this table to gather insights on stages, such as the last updated time of the stage, stage variables, auto deployment details, and more. The schema outlines for you the various attributes of the API Gateway stage, including the stage name, API ID, created date, and associated tags.

Examples

List of API gateway V2 stages which does not send logs to cloud watch log

Identify instances where API Gateway stages are not configured to send logs to Cloud Watch, which could help in troubleshooting and analyzing API performance.

select
stage_name,
api_id,
default_route_data_trace_enabled
from
aws_api_gatewayv2_stage
where
not default_route_data_trace_enabled;
select
stage_name,
api_id,
default_route_data_trace_enabled
from
aws_api_gatewayv2_stage
where
default_route_data_trace_enabled = 0;

Default route settings info of each API gateway V2 stage

Explore the default settings of each stage in your API gateway to understand how data tracing, detailed metrics, and throttling limits are configured. This helps in managing your API effectively by fine-tuning these settings as per your requirements.

select
stage_name,
api_id,
default_route_data_trace_enabled,
default_route_detailed_metrics_enabled,
default_route_throttling_burst_limit,
default_route_throttling_rate_limit
from
aws_api_gatewayv2_stage;
select
stage_name,
api_id,
default_route_data_trace_enabled,
default_route_detailed_metrics_enabled,
default_route_throttling_burst_limit,
default_route_throttling_rate_limit
from
aws_api_gatewayv2_stage;

Count of API gateway V2 stages by APIs

Determine the quantity of stages each API Gateway has, which can be useful for understanding the complexity and scale of each individual API.

select
api_id,
count(stage_name) stage_count
from
aws_api_gatewayv2_stage
group by
api_id;
select
api_id,
count(stage_name) as stage_count
from
aws_api_gatewayv2_stage
group by
api_id;

Get access log settings of API gateway V2 stages

Discover the configuration settings of different stages in API gateway V2 to better understand and manage access logs and data tracing. This can be useful for enhancing security and troubleshooting issues.

select
stage_name,
api_id,
default_route_data_trace_enabled,
jsonb_pretty(access_log_settings) as access_log_settings
from
aws_api_gatewayv2_stage;
select
stage_name,
api_id,
default_route_data_trace_enabled,
access_log_settings
from
aws_api_gatewayv2_stage;

Schema for aws_api_gatewayv2_stage

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
access_log_settingsjsonbAccess log settings of the stage.
account_idtextThe AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
api_gateway_managedbooleanSpecifies whether a stage is managed by API Gateway
api_idtext=The id of the api which contains this stage
auto_deploybooleanSpecifies whether updates to an API automatically trigger a new deployment
client_certificate_idtextThe identifier of a client certificate for a Stage. Supported only for WebSocket APIs
created_datetextThe timestamp when the stage was created
default_route_data_trace_enabledbooleanSpecifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs
default_route_detailed_metrics_enabledbooleanSpecifies whether detailed metrics are enabled
default_route_logging_leveltextSpecifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs
default_route_throttling_burst_limitbigintThrottling burst limit for default route settings
default_route_throttling_rate_limitdouble precisionThrottling rate limit for default route settings
deployment_idtextThe identifier of the Deployment that the Stage is associated with
descriptiontextThe stage's description
last_deployment_status_messagetextDescribes the status of the last deployment of a stage. Supported only for stages with autoDeploy enabled
last_updated_datetextThe timestamp when the stage was last updated
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
stage_nametext=The name of the stage
stage_variablesjsonbA map that defines the stage variables for a stage resource
tagsjsonbA map of tags for the resource.
titletextTitle 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_gatewayv2_stage