Skip to main content

Integration

Manages an Api Gateway V2 Integration.

Sample code

Lambda integration

exports.createResources = () => [
{
type: "Integration",
group: "ApiGatewayV2",
properties: ({}) => ({
ConnectionType: "INTERNET",
IntegrationMethod: "POST",
IntegrationType: "AWS_PROXY",
PayloadFormatVersion: "2.0",
}),
dependencies: ({}) => ({
api: "my-api",
lambdaFunction: "my-function",
}),
},
];

Load Balancer integration

exports.createResources = () => [
{
type: "Integration",
group: "ApiGatewayV2",
properties: ({}) => ({
ConnectionType: "VPC_LINK",
Description: "API Integration with AWS Fargate Service",
IntegrationMethod: "GET",
IntegrationType: "HTTP_PROXY",
PayloadFormatVersion: "1.0",
}),
dependencies: ({}) => ({
api: "ApigwFargate",
listener: "listener::CdkSt-MyFar-RZX6AW5H3B08::HTTP::80",
vpcLink: "V2 VPC Link",
}),
},
];

Event Bus integration

exports.createResources = () => [
{
type: "Integration",
group: "ApiGatewayV2",
properties: ({}) => ({
ConnectionType: "INTERNET",
IntegrationSubtype: "EventBridge-PutEvents",
IntegrationType: "AWS_PROXY",
PayloadFormatVersion: "1.0",
RequestParameters: {
DetailType: "MyDetailType",
Source: "WebApp",
Detail: "$request.body",
},
TimeoutInMillis: 10000,
}),
dependencies: ({}) => ({
api: "MyHttpApi",
eventBus: "MyEventBus",
role: "ApiEventbridgeStack-EventBridgeIntegrationRoleB322-V1AK3L262GGK",
}),
},
];

Properties

Dependencies

Used By

Full Examples

List

The Integrations can be filtered with the ApiGatewayV2::Integration type:

gc l -t ApiGatewayV2::Integration
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 6/6
┌────────────────────────────────────────────────────────────────────────────────────┐
│ 1 ApiGatewayV2::Integration from aws │
├────────────────────────────────────────────────────────────────────────────────────┤
│ name: integration::my-api::my-function │
│ managedByUs: Yes │
│ live: │
│ ConnectionType: INTERNET │
│ IntegrationId: tcymupe │
│ IntegrationMethod: POST │
│ IntegrationType: AWS_PROXY │
│ IntegrationUri: arn:aws:lambda:eu-west-2:840541460064:function:my-function │
│ PayloadFormatVersion: 2.0 │
│ TimeoutInMillis: 30000 │
│ ApiId: 7a38wlw431 │
│ ApiName: my-api │
│ Tags: │
│ gc-managed-by: grucloud │
│ gc-project-name: @grucloud/example-aws-api-gateway-lambda │
│ gc-stage: dev │
│ gc-created-by-provider: aws │
│ │
└────────────────────────────────────────────────────────────────────────────────────┘


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