Amazon API Gateway v2 ExecModule
Overview
AwsApiGatewayV2Module inventories HTTP and WebSocket APIs in an AWS account and region and reads deployment settings for the stages of a selected API. Use it to build a regional API inventory, compare stage settings with your release policy, or add deployment context to an incident.
The API inventory gives you the identifier to use for the stage lookup. A stage result shows the deployment identifier and whether automatic deployment is enabled when AWS provides those fields. Use application telemetry and release records separately to assess availability and establish which changes reached a stage.
Usage
- Create an Amazon API Gateway v2 connection in the Integration Account Console. Verify the connection and confirm it is
READY. - Add Amazon API Gateway v2 to a Workflow Studio task, select the connection under General > Connection, and enter the AWS region.
- Run
list_apisto find the API ID, then map that ID toapiIdon alist_stagestask. - Check
statusbefore using the results. IfhasMoreis true, passnextTokento a subsequent invocation with the same parameters.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | No | list_apis | Select list_apis or list_stages. |
region | string | Yes | — | Commercial AWS or AWS GovCloud region to query. |
apiId | string | For list_stages | — | AWS API identifier of 1–32 lowercase alphanumeric characters. Omit for list_apis. |
pageSize | integer | No | 50 | Request 1–100 results per page. |
nextToken | string | No | — | Opaque continuation token returned by AWS, up to 4,096 printable ASCII characters. |
Outputs
| Output | Meaning |
|---|---|
status | success or error. |
operation, region, apiId | Operation and request scope when available. apiId identifies the API queried by list_stages. |
apis | One page of API records with apiId, name, protocolType, and disableExecuteApiEndpoint when available. |
stages | One page of stage records with stageName, deploymentId, and autoDeploy when available. |
hasMore, nextToken | Whether AWS returned a continuation token and the token when present. |
requestId | AWS request reference when available. |
error | Redacted failure with code, message, retryable, and httpStatus when available. |
IntegrationAccount Requirements
Use a verified IntegrationAccount with account name AWS and status READY. Store the key pair in the protected AWS Access Key ID and AWS Secret Access Key fields. The module uses AWS Signature Version 4. This connector supports a basic access key pair. Session-token and assumed-role credentials are outside its scope.
Grant apigateway:GET on the resources the workflow reads. In the commercial AWS partition, use arn:aws:apigateway:<region>::/apis for list_apis and arn:aws:apigateway:<region>::/apis/<apiId>/stages for list_stages, replacing the placeholders with your region and API ID. For GovCloud, use the aws-us-gov partition. AWS API Gateway Management V2 authorization reference
Configuration
Select the account through the Integration Account connection and set the region in the task. The module derives the regional HTTPS management endpoint from the region. Use separate invocations for each account and region. Keep credential values in the protected connection fields and out of task inputs and logs.
Operations
list_apiscallsGetApisfor one regional page of API records. Compare API types and default endpoint settings, or pass an API ID to the stage operation. AWS GetApis referencelist_stagescallsGetStagesfor one page of stages for a supplied API ID. Compare deployment identifiers with a saved inventory, or flag stages whose automatic deployment setting differs from your policy. AWS GetStages reference
Errors and Failure Modes
- For
VALIDATION_ERROR, check the operation, region, page size, and whether the operation requires an API ID. - For
INTEGRATION_ACCOUNT_ERROR, verify that the selected AWS account isREADYand has both protected key fields. - If AWS denies access, check the requested region and the
apigateway:GETresource scope. If AWS cannot find the API, verify the account, region, and ID before retrying. Save the AWS request ID when present. - The AWS SDK can retry eligible transient failures up to twice. Follow the returned
retryableflag if the request still fails. Use backoff and bound concurrency when polling multiple APIs with one connection. If AWS rejects an expired or invalid token, restart pagination with the original parameters.
Example
A release-review workflow can inspect the stages of a checkout API found by list_apis.
{
"operation": "list_stages",
"region": "us-west-2",
"apiId": "a1b2c3d4e5",
"pageSize": 25
}
One possible result follows.
{
"status": "success",
"operation": "list_stages",
"region": "us-west-2",
"apiId": "a1b2c3d4e5",
"stages": [
{
"stageName": "production",
"deploymentId": "dep42x",
"autoDeploy": false
}
],
"hasMore": false
}
The production stage reports deployment dep42x and automatic deployment is off. The workflow can compare that ID with the deployment approved for production and send a mismatch to the release reviewer.
Notes
- Read one page per invocation. Keep the connection, operation, region, API ID where applicable, and page size fixed when following a continuation token. Inventory can change during pagination.
- Both operations are read-only and safe to repeat. This connector covers HTTP and WebSocket APIs. REST API v1, route and integration inventory, stage variables, and configuration changes are outside its scope.
- Results omit raw AWS response bodies, tags, and endpoint URLs.
disableExecuteApiEndpointdescribes the default endpoint setting, while custom domains and invocation access must be checked separately.