# HttpServiceDiscoveryIntegration

The Service Discovery integration resource for HTTP API.

Extends: [HttpRouteIntegration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpRouteIntegration.html) › HttpServiceDiscoveryIntegration

- Source: [`aws-apigatewayv2-integrations/lib/http/service-discovery.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/http/service-discovery.ts#L17)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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
    })
});
```

Golang:

```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,
	}),
})
```

## Initializer

TypeScript:

```ts
new HttpServiceDiscoveryIntegration(id: string, service: IServiceRef, props?: HttpServiceDiscoveryIntegrationProps)
```

Python:

```python
HttpServiceDiscoveryIntegration(id: str, service: IServiceRef, props: typing.Optional[HttpServiceDiscoveryIntegrationProps] = None)
```

Java:

```java
new HttpServiceDiscoveryIntegration(String id, IServiceRef service, HttpServiceDiscoveryIntegrationProps props)
```

C# / .NET:

```csharp
new HttpServiceDiscoveryIntegration(string id, IServiceRef service, HttpServiceDiscoveryIntegrationProps? props = null)
```

Golang:

```go
NewHttpServiceDiscoveryIntegration(Id *string, Service IServiceRef, Props HttpServiceDiscoveryIntegrationProps)
```

## Methods

- `bind(options: HttpRouteIntegrationBindOptions): HttpRouteIntegrationConfig` — Bind this integration to the route.
