Skip to main content

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​

  1. Create an Amazon API Gateway v2 connection in the Integration Account Console. Verify the connection and confirm it is READY.
  2. Add Amazon API Gateway v2 to a Workflow Studio task, select the connection under General > Connection, and enter the AWS region.
  3. Run list_apis to find the API ID, then map that ID to apiId on a list_stages task.
  4. Check status before using the results. If hasMore is true, pass nextToken to a subsequent invocation with the same parameters.

Inputs​

InputTypeRequiredDefaultPurpose
operationstringNolist_apisSelect list_apis or list_stages.
regionstringYes—Commercial AWS or AWS GovCloud region to query.
apiIdstringFor list_stages—AWS API identifier of 1–32 lowercase alphanumeric characters. Omit for list_apis.
pageSizeintegerNo50Request 1–100 results per page.
nextTokenstringNo—Opaque continuation token returned by AWS, up to 4,096 printable ASCII characters.

Outputs​

OutputMeaning
statussuccess or error.
operation, region, apiIdOperation and request scope when available. apiId identifies the API queried by list_stages.
apisOne page of API records with apiId, name, protocolType, and disableExecuteApiEndpoint when available.
stagesOne page of stage records with stageName, deploymentId, and autoDeploy when available.
hasMore, nextTokenWhether AWS returned a continuation token and the token when present.
requestIdAWS request reference when available.
errorRedacted 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_apis calls GetApis for one regional page of API records. Compare API types and default endpoint settings, or pass an API ID to the stage operation. AWS GetApis reference
  • list_stages calls GetStages for 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 is READY and has both protected key fields.
  • If AWS denies access, check the requested region and the apigateway:GET resource 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 retryable flag 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. disableExecuteApiEndpoint describes the default endpoint setting, while custom domains and invocation access must be checked separately.