Skip to content
v2.278.0

HttpServiceDiscoveryIntegrationProps Struct ​

Properties to initialize HttpServiceDiscoveryIntegration.

Example ​

ts
import * as servicediscovery from 'aws-cdk-lib/aws-servicediscovery';
import { HttpServiceDiscoveryIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

const vpc = new ec2.Vpc(this, 'VPC');
const vpcLink = new apigwv2.VpcLink(this, 'VpcLink', { vpc });
const namespace = new servicediscovery.PrivateDnsNamespace(this, 'Namespace', {
  name: 'boobar.com',
  vpc,
});
const service = namespace.createService('Service');

const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
  defaultIntegration: new HttpServiceDiscoveryIntegration('DefaultIntegration', service, {
    vpcLink,
  }),
});
python
import aws_cdk.aws_servicediscovery as servicediscovery
from aws_cdk.aws_apigatewayv2_integrations import HttpServiceDiscoveryIntegration


vpc = ec2.Vpc(self, "VPC")
vpc_link = apigwv2.VpcLink(self, "VpcLink", vpc=vpc)
namespace = servicediscovery.PrivateDnsNamespace(self, "Namespace",
    name="boobar.com",
    vpc=vpc
)
service = namespace.create_service("Service")

http_endpoint = apigwv2.HttpApi(self, "HttpProxyPrivateApi",
    default_integration=HttpServiceDiscoveryIntegration("DefaultIntegration", service,
        vpc_link=vpc_link
    )
)
java
import software.amazon.awscdk.services.servicediscovery.*;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpServiceDiscoveryIntegration;


Vpc vpc = new Vpc(this, "VPC");
VpcLink vpcLink = VpcLink.Builder.create(this, "VpcLink").vpc(vpc).build();
PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(this, "Namespace")
        .name("boobar.com")
        .vpc(vpc)
        .build();
Service service = namespace.createService("Service");

HttpApi httpEndpoint = HttpApi.Builder.create(this, "HttpProxyPrivateApi")
        .defaultIntegration(HttpServiceDiscoveryIntegration.Builder.create("DefaultIntegration", service)
                .vpcLink(vpcLink)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.ServiceDiscovery;
using Amazon.CDK.AwsApigatewayv2Integrations;


var vpc = new Vpc(this, "VPC");
var vpcLink = new VpcLink(this, "VpcLink", new VpcLinkProps { Vpc = vpc });
var namespace = new PrivateDnsNamespace(this, "Namespace", new PrivateDnsNamespaceProps {
    Name = "boobar.com",
    Vpc = vpc
});
var service = namespace.CreateService("Service");

var httpEndpoint = new HttpApi(this, "HttpProxyPrivateApi", new HttpApiProps {
    DefaultIntegration = new HttpServiceDiscoveryIntegration("DefaultIntegration", service, new HttpServiceDiscoveryIntegrationProps {
        VpcLink = vpcLink
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import servicediscovery "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"


vpc := ec2.NewVpc(this, jsii.String("VPC"))
vpcLink := apigwv2.NewVpcLink(this, jsii.String("VpcLink"), &VpcLinkProps{
	Vpc: Vpc,
})
namespace := servicediscovery.NewPrivateDnsNamespace(this, jsii.String("Namespace"), &PrivateDnsNamespaceProps{
	Name: jsii.String("boobar.com"),
	Vpc: Vpc,
})
service := namespace.CreateService(jsii.String("Service"))

httpEndpoint := apigwv2.NewHttpApi(this, jsii.String("HttpProxyPrivateApi"), &HttpApiProps{
	DefaultIntegration: awscdk.NewHttpServiceDiscoveryIntegration(jsii.String("DefaultIntegration"), service, &HttpServiceDiscoveryIntegrationProps{
		VpcLink: *VpcLink,
	}),
})

Properties ​

methodoptionalHttpMethodmethodoptionalHttpMethodmethodoptionalHttpMethodMethodoptionalHttpMethodMethodoptionalHttpMethod = HttpMethod.ANY #
The HTTP method that must be used to invoke the underlying HTTP proxy.
parameterMappingoptionalParameterMappingparameter_mappingoptionalParameterMappingparameterMappingoptionalParameterMappingParameterMappingoptionalParameterMappingParameterMappingoptionalParameterMapping #
Specifies how to transform HTTP requests before sending them to the backend.

Default: undefined requests are sent to the backend unmodified

secureServerNameoptionalstringsecure_server_nameoptionalstrsecureServerNameoptionalStringSecureServerNameoptionalstringSecureServerNameoptional*string #
Specifies the server name to verified by HTTPS when calling the backend integration.

Default: undefined private integration traffic will use HTTP protocol

timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration = Duration.seconds(29) #
The maximum amount of time an integration will run before it returns without a response.

Must be between 50 milliseconds and 29 seconds.