ConnectionType Enum
| Source | aws-apigateway/lib/integration.ts |
|---|
Example
ts
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
const vpc = new ec2.Vpc(this, 'VPC');
const nlb = new elbv2.NetworkLoadBalancer(this, 'NLB', {
vpc,
});
const link = new apigateway.VpcLink(this, 'link', {
targets: [nlb],
});
const integration = new apigateway.Integration({
type: apigateway.IntegrationType.HTTP_PROXY,
integrationHttpMethod: 'ANY',
options: {
connectionType: apigateway.ConnectionType.VPC_LINK,
vpcLink: link,
},
});
python
import aws_cdk.aws_elasticloadbalancingv2 as elbv2
vpc = ec2.Vpc(self, "VPC")
nlb = elbv2.NetworkLoadBalancer(self, "NLB",
vpc=vpc
)
link = apigateway.VpcLink(self, "link",
targets=[nlb]
)
integration = apigateway.Integration(
type=apigateway.IntegrationType.HTTP_PROXY,
integration_http_method="ANY",
options=apigateway.IntegrationOptions(
connection_type=apigateway.ConnectionType.VPC_LINK,
vpc_link=link
)
)
java
import software.amazon.awscdk.services.elasticloadbalancingv2.*;
Vpc vpc = new Vpc(this, "VPC");
NetworkLoadBalancer nlb = NetworkLoadBalancer.Builder.create(this, "NLB")
.vpc(vpc)
.build();
VpcLink link = VpcLink.Builder.create(this, "link")
.targets(List.of(nlb))
.build();
Integration integration = Integration.Builder.create()
.type(IntegrationType.HTTP_PROXY)
.integrationHttpMethod("ANY")
.options(IntegrationOptions.builder()
.connectionType(ConnectionType.VPC_LINK)
.vpcLink(link)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
var vpc = new Vpc(this, "VPC");
var nlb = new NetworkLoadBalancer(this, "NLB", new NetworkLoadBalancerProps {
Vpc = vpc
});
var link = new VpcLink(this, "link", new VpcLinkProps {
Targets = new [] { nlb }
});
var integration = new Integration(new IntegrationProps {
Type = IntegrationType.HTTP_PROXY,
IntegrationHttpMethod = "ANY",
Options = new IntegrationOptions {
ConnectionType = ConnectionType.VPC_LINK,
VpcLink = link
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import elbv2 "github.com/aws/aws-cdk-go/awscdk"
vpc := ec2.NewVpc(this, jsii.String("VPC"))
nlb := elbv2.NewNetworkLoadBalancer(this, jsii.String("NLB"), &NetworkLoadBalancerProps{
Vpc: Vpc,
})
link := apigateway.NewVpcLink(this, jsii.String("link"), &VpcLinkProps{
Targets: []INetworkLoadBalancer{
nlb,
},
})
integration := apigateway.NewIntegration(&IntegrationProps{
Type: apigateway.IntegrationType_HTTP_PROXY,
IntegrationHttpMethod: jsii.String("ANY"),
Options: &IntegrationOptions{
ConnectionType: apigateway.ConnectionType_VPC_LINK,
VpcLink: link,
},
})
Members
| Member | Description |
|---|---|
INTERNET | For connections through the public routable internet. |
VPC_LINK | For private connections between API Gateway and a network load balancer in a VPC. |
Referenced by
IntegrationOptions.connectionTypeconnection_typeconnectionTypeConnectionTypeConnectionType