import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an Amazon API Gateway Version 2 integration. * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Integration("example", { * apiId: exampleAwsApigatewayv2Api.id, * integrationType: "MOCK", * }); * ``` * * ### Lambda Integration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.Function("example", { * code: new pulumi.asset.FileArchive("example.zip"), * name: "Example", * role: exampleAwsIamRole.arn, * handler: "index.handler", * runtime: aws.lambda.Runtime.NodeJS24dX, * }); * const exampleIntegration = new aws.apigatewayv2.Integration("example", { * apiId: exampleAwsApigatewayv2Api.id, * integrationType: "AWS_PROXY", * connectionType: "INTERNET", * contentHandlingStrategy: "CONVERT_TO_TEXT", * description: "Lambda example", * integrationMethod: "POST", * integrationUri: example.invokeArn, * passthroughBehavior: "WHEN_NO_MATCH", * }); * ``` * * ### AWS Service Integration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Integration("example", { * apiId: exampleAwsApigatewayv2Api.id, * credentialsArn: exampleAwsIamRole.arn, * description: "SQS example", * integrationType: "AWS_PROXY", * integrationSubtype: "SQS-SendMessage", * requestParameters: { * QueueUrl: "$request.header.queueUrl", * MessageBody: "$request.body.message", * }, * }); * ``` * * ### Private Integration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Integration("example", { * tlsConfig: { * serverNameToVerify: "example.com", * }, * responseParameters: [ * { * statusCode: "403", * mappings: { * "append:header.auth": "$context.authorizer.authorizerResponse", * }, * }, * { * statusCode: "200", * mappings: { * "overwrite:statuscode": "204", * }, * }, * ], * apiId: exampleAwsApigatewayv2Api.id, * credentialsArn: exampleAwsIamRole.arn, * description: "Example with a load balancer", * integrationType: "HTTP_PROXY", * integrationUri: exampleAwsLbListener.arn, * integrationMethod: "ANY", * connectionType: "VPC_LINK", * connectionId: exampleAwsApigatewayv2VpcLink.id, * requestParameters: { * "append:header.authforintegration": "$context.authorizer.authorizerResponse", * "overwrite:path": "staticValueForIntegration", * }, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `apiId` (String) API identifier. * * `id` (String) Integration identifier. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import `aws.apigatewayv2.Integration` using the API identifier and integration identifier. For example: * * ```sh * $ pulumi import aws:apigatewayv2/integration:Integration example aabbccddee/1122334 * ``` * * > **Note:** The API Gateway managed integration created as part of [*quick_create*](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-basic-concept.html#apigateway-definition-quick-create) cannot be imported. */ export declare class Integration extends pulumi.CustomResource { /** * Get an existing Integration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: IntegrationState, opts?: pulumi.CustomResourceOptions): Integration; /** * Returns true if the given object is an instance of Integration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Integration; /** * API identifier. */ readonly apiId: pulumi.Output; /** * ID of the VPC link for a private integration. Supported only for HTTP APIs. Must be between 1 and 1024 characters in length. */ readonly connectionId: pulumi.Output; /** * Type of the network connection to the integration endpoint. Valid values: `INTERNET`, `VPC_LINK`. Default is `INTERNET`. */ readonly connectionType: pulumi.Output; /** * How to handle response payload content type conversions. Valid values: `CONVERT_TO_BINARY`, `CONVERT_TO_TEXT`. Supported only for WebSocket APIs. */ readonly contentHandlingStrategy: pulumi.Output; /** * Credentials required for the integration, if any. */ readonly credentialsArn: pulumi.Output; /** * Description of the integration. */ readonly description: pulumi.Output; /** * Integration's HTTP method. Must be specified if `integrationType` is not `MOCK`. */ readonly integrationMethod: pulumi.Output; /** * [Integration response selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-integration-response-selection-expressions) for the integration. */ readonly integrationResponseSelectionExpression: pulumi.Output; /** * AWS service action to invoke. Supported only for HTTP APIs when `integrationType` is `AWS_PROXY`. See the [AWS service integration reference](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html) documentation for supported values. Must be between 1 and 128 characters in length. */ readonly integrationSubtype: pulumi.Output; /** * Integration type of an integration. Valid values: `AWS` (supported only for WebSocket APIs), `AWS_PROXY`, `HTTP` (supported only for WebSocket APIs), `HTTP_PROXY`, `MOCK` (supported only for WebSocket APIs). For an HTTP API private integration, use `HTTP_PROXY`. */ readonly integrationType: pulumi.Output; /** * URI of the Lambda function for a Lambda proxy integration, when `integrationType` is `AWS_PROXY`. For an `HTTP` integration, specify a fully-qualified URL. For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. */ readonly integrationUri: pulumi.Output; /** * Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the `requestTemplates` attribute. Valid values: `WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`. Default is `WHEN_NO_MATCH`. Supported only for WebSocket APIs. */ readonly passthroughBehavior: pulumi.Output; /** * [Format of the payload](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format) sent to an integration. Valid values: `1.0`, `2.0`. Default is `1.0`. */ readonly payloadFormatVersion: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. For HTTP APIs with a specified `integrationSubtype`, a key-value map specifying parameters that are passed to `AWS_PROXY` integrations. For HTTP APIs without a specified `integrationSubtype`, a key-value map specifying how to transform HTTP requests before sending them to the backend. See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html) for details. */ readonly requestParameters: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of [Velocity](https://velocity.apache.org/) templates that are applied on the request payload based on the value of the Content-Type header sent by the client. Supported only for WebSocket APIs. */ readonly requestTemplates: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Mappings to transform the HTTP response from a backend integration before returning the response to clients. Supported only for HTTP APIs. */ readonly responseParameters: pulumi.Output; /** * [Template selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-template-selection-expressions) for the integration. */ readonly templateSelectionExpression: pulumi.Output; /** * Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs. this provider will only perform drift detection of its value when present in a configuration. */ readonly timeoutMilliseconds: pulumi.Output; /** * TLS configuration for a private integration. Supported only for HTTP APIs. */ readonly tlsConfig: pulumi.Output; /** * Create a Integration resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: IntegrationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Integration resources. */ export interface IntegrationState { /** * API identifier. */ apiId?: pulumi.Input; /** * ID of the VPC link for a private integration. Supported only for HTTP APIs. Must be between 1 and 1024 characters in length. */ connectionId?: pulumi.Input; /** * Type of the network connection to the integration endpoint. Valid values: `INTERNET`, `VPC_LINK`. Default is `INTERNET`. */ connectionType?: pulumi.Input; /** * How to handle response payload content type conversions. Valid values: `CONVERT_TO_BINARY`, `CONVERT_TO_TEXT`. Supported only for WebSocket APIs. */ contentHandlingStrategy?: pulumi.Input; /** * Credentials required for the integration, if any. */ credentialsArn?: pulumi.Input; /** * Description of the integration. */ description?: pulumi.Input; /** * Integration's HTTP method. Must be specified if `integrationType` is not `MOCK`. */ integrationMethod?: pulumi.Input; /** * [Integration response selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-integration-response-selection-expressions) for the integration. */ integrationResponseSelectionExpression?: pulumi.Input; /** * AWS service action to invoke. Supported only for HTTP APIs when `integrationType` is `AWS_PROXY`. See the [AWS service integration reference](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html) documentation for supported values. Must be between 1 and 128 characters in length. */ integrationSubtype?: pulumi.Input; /** * Integration type of an integration. Valid values: `AWS` (supported only for WebSocket APIs), `AWS_PROXY`, `HTTP` (supported only for WebSocket APIs), `HTTP_PROXY`, `MOCK` (supported only for WebSocket APIs). For an HTTP API private integration, use `HTTP_PROXY`. */ integrationType?: pulumi.Input; /** * URI of the Lambda function for a Lambda proxy integration, when `integrationType` is `AWS_PROXY`. For an `HTTP` integration, specify a fully-qualified URL. For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. */ integrationUri?: pulumi.Input; /** * Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the `requestTemplates` attribute. Valid values: `WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`. Default is `WHEN_NO_MATCH`. Supported only for WebSocket APIs. */ passthroughBehavior?: pulumi.Input; /** * [Format of the payload](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format) sent to an integration. Valid values: `1.0`, `2.0`. Default is `1.0`. */ payloadFormatVersion?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. For HTTP APIs with a specified `integrationSubtype`, a key-value map specifying parameters that are passed to `AWS_PROXY` integrations. For HTTP APIs without a specified `integrationSubtype`, a key-value map specifying how to transform HTTP requests before sending them to the backend. See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html) for details. */ requestParameters?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of [Velocity](https://velocity.apache.org/) templates that are applied on the request payload based on the value of the Content-Type header sent by the client. Supported only for WebSocket APIs. */ requestTemplates?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Mappings to transform the HTTP response from a backend integration before returning the response to clients. Supported only for HTTP APIs. */ responseParameters?: pulumi.Input[] | undefined>; /** * [Template selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-template-selection-expressions) for the integration. */ templateSelectionExpression?: pulumi.Input; /** * Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs. this provider will only perform drift detection of its value when present in a configuration. */ timeoutMilliseconds?: pulumi.Input; /** * TLS configuration for a private integration. Supported only for HTTP APIs. */ tlsConfig?: pulumi.Input; } /** * The set of arguments for constructing a Integration resource. */ export interface IntegrationArgs { /** * API identifier. */ apiId: pulumi.Input; /** * ID of the VPC link for a private integration. Supported only for HTTP APIs. Must be between 1 and 1024 characters in length. */ connectionId?: pulumi.Input; /** * Type of the network connection to the integration endpoint. Valid values: `INTERNET`, `VPC_LINK`. Default is `INTERNET`. */ connectionType?: pulumi.Input; /** * How to handle response payload content type conversions. Valid values: `CONVERT_TO_BINARY`, `CONVERT_TO_TEXT`. Supported only for WebSocket APIs. */ contentHandlingStrategy?: pulumi.Input; /** * Credentials required for the integration, if any. */ credentialsArn?: pulumi.Input; /** * Description of the integration. */ description?: pulumi.Input; /** * Integration's HTTP method. Must be specified if `integrationType` is not `MOCK`. */ integrationMethod?: pulumi.Input; /** * AWS service action to invoke. Supported only for HTTP APIs when `integrationType` is `AWS_PROXY`. See the [AWS service integration reference](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html) documentation for supported values. Must be between 1 and 128 characters in length. */ integrationSubtype?: pulumi.Input; /** * Integration type of an integration. Valid values: `AWS` (supported only for WebSocket APIs), `AWS_PROXY`, `HTTP` (supported only for WebSocket APIs), `HTTP_PROXY`, `MOCK` (supported only for WebSocket APIs). For an HTTP API private integration, use `HTTP_PROXY`. */ integrationType: pulumi.Input; /** * URI of the Lambda function for a Lambda proxy integration, when `integrationType` is `AWS_PROXY`. For an `HTTP` integration, specify a fully-qualified URL. For an HTTP API private integration, specify the ARN of an Application Load Balancer listener, Network Load Balancer listener, or AWS Cloud Map service. */ integrationUri?: pulumi.Input; /** * Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the `requestTemplates` attribute. Valid values: `WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`. Default is `WHEN_NO_MATCH`. Supported only for WebSocket APIs. */ passthroughBehavior?: pulumi.Input; /** * [Format of the payload](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format) sent to an integration. Valid values: `1.0`, `2.0`. Default is `1.0`. */ payloadFormatVersion?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * For WebSocket APIs, a key-value map specifying request parameters that are passed from the method request to the backend. For HTTP APIs with a specified `integrationSubtype`, a key-value map specifying parameters that are passed to `AWS_PROXY` integrations. For HTTP APIs without a specified `integrationSubtype`, a key-value map specifying how to transform HTTP requests before sending them to the backend. See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html) for details. */ requestParameters?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of [Velocity](https://velocity.apache.org/) templates that are applied on the request payload based on the value of the Content-Type header sent by the client. Supported only for WebSocket APIs. */ requestTemplates?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Mappings to transform the HTTP response from a backend integration before returning the response to clients. Supported only for HTTP APIs. */ responseParameters?: pulumi.Input[] | undefined>; /** * [Template selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-template-selection-expressions) for the integration. */ templateSelectionExpression?: pulumi.Input; /** * Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs. this provider will only perform drift detection of its value when present in a configuration. */ timeoutMilliseconds?: pulumi.Input; /** * TLS configuration for a private integration. Supported only for HTTP APIs. */ tlsConfig?: pulumi.Input; } //# sourceMappingURL=integration.d.ts.map