Skip to main content

Stage

Manages an Api Gateway V2 Stage.

Sample code

exports.createResources = () => [
{
type: "Stage",
group: "ApiGatewayV2",
properties: ({}) => ({
AccessLogSettings: {
Format:
'$context.identity.sourceIp - - [$context.requestTime] "$context.httpMethod $context.routeKey $context.protocol" $context.status $context.responseLength $context.requestId',
},
StageName: "my-api-stage-dev",
}),
dependencies: () => ({
api: "my-api",
logGroup: "lg-http-test",
}),
},
{ type: "LogGroup", group: "CloudWatchLogs", name: "lg-http-test" },
];

Properties

Dependencies

Used By

Full Examples

List

The Stages can be filtered with the ApiGatewayV2::Stage type:

gc l -t ApiGatewayV2::Stage
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 3/3
┌────────────────────────────────────────────────────────────────────────────────────┐
│ 1 ApiGatewayV2::Stage from aws │
├────────────────────────────────────────────────────────────────────────────────────┤
│ name: my-api-stage-dev │
│ managedByUs: Yes │
│ live: │
│ AccessLogSettings: │
│ DestinationArn: arn:aws:logs:eu-west-2:840541460064:log-group:lg-http-test │
│ Format: $context.identity.sourceIp - - [$context.requestTime] "$context.httpM… │
│ CreatedDate: 2021-10-14T17:37:16.000Z │
│ DefaultRouteSettings: │
│ DetailedMetricsEnabled: false │
│ DeploymentId: icit03 │
│ LastUpdatedDate: 2021-10-14T17:37:41.000Z │
│ RouteSettings: │
│ StageName: my-api-stage-dev │
│ StageVariables: │
│ Tags: │
│ gc-managed-by: grucloud │
│ gc-project-name: @grucloud/example-aws-api-gateway-lambda │
│ gc-stage: dev │
│ gc-created-by-provider: aws │
│ Name: my-api-stage-dev │
│ ApiId: 7a38wlw431 │
│ │
└────────────────────────────────────────────────────────────────────────────────────┘


List Summary:
Provider: aws
┌───────────────────────────────────────────────────────────────────────────────────┐
│ aws │
├─────────────────────┬─────────────────────────────────────────────────────────────┤
│ ApiGatewayV2::Stage │ my-api-stage-dev │
└─────────────────────┴─────────────────────────────────────────────────────────────┘
1 resource, 1 type, 1 provider
Command "gc l -t ApiGatewayV2::Stage" executed in 6s