class HttpUrlIntegration
Language | Type name |
---|---|
![]() | Amazon.CDK.AwsApigatewayv2Integrations.HttpUrlIntegration |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2integrations#HttpUrlIntegration |
![]() | software.amazon.awscdk.aws_apigatewayv2_integrations.HttpUrlIntegration |
![]() | aws_cdk.aws_apigatewayv2_integrations.HttpUrlIntegration |
![]() | aws-cdk-lib » aws_apigatewayv2_integrations » HttpUrlIntegration |
Extends
Http
The HTTP Proxy integration resource for HTTP API.
Example
import { HttpLambdaAuthorizer, HttpLambdaResponseType } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
import { HttpUrlIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
// This function handles your auth logic
declare const authHandler: lambda.Function;
const authorizer = new HttpLambdaAuthorizer('BooksAuthorizer', authHandler, {
responseTypes: [HttpLambdaResponseType.SIMPLE], // Define if returns simple and/or iam response
});
const api = new apigwv2.HttpApi(this, 'HttpApi');
api.addRoutes({
integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
path: '/books',
authorizer,
});
Initializer
new HttpUrlIntegration(id: string, url: string, props?: HttpUrlIntegrationProps)
Parameters
- id
string
— id of the underlying integration construct. - url
string
— the URL to proxy to. - props
Http
— properties to configure the integration.Url Integration Props
Methods
Name | Description |
---|---|
bind(_options) | Bind this integration to the route. |
bind(_options)
public bind(_options: HttpRouteIntegrationBindOptions): HttpRouteIntegrationConfig
Parameters
- _options
Http
Route Integration Bind Options
Returns
Bind this integration to the route.