IntegrationArgs

data class IntegrationArgs(val apiId: Output<String>? = null, val connectionId: Output<String>? = null, val connectionType: Output<String>? = null, val contentHandlingStrategy: Output<String>? = null, val credentialsArn: Output<String>? = null, val description: Output<String>? = null, val integrationMethod: Output<String>? = null, val integrationSubtype: Output<String>? = null, val integrationType: Output<String>? = null, val integrationUri: Output<String>? = null, val passthroughBehavior: Output<String>? = null, val payloadFormatVersion: Output<String>? = null, val requestParameters: Output<Map<String, String>>? = null, val requestTemplates: Output<Map<String, String>>? = null, val responseParameters: Output<List<IntegrationResponseParameterArgs>>? = null, val templateSelectionExpression: Output<String>? = null, val timeoutMilliseconds: Output<Int>? = null, val tlsConfig: Output<IntegrationTlsConfigArgs>? = null) : ConvertibleToJava<IntegrationArgs>

Manages an Amazon API Gateway Version 2 integration. More information can be found in the Amazon API Gateway Developer Guide.

Example Usage

Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Integration;
import com.pulumi.aws.apigatewayv2.IntegrationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Integration("example", IntegrationArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.integrationType("MOCK")
.build());
}
}

Lambda Integration

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lambda.Function;
import com.pulumi.aws.lambda.FunctionArgs;
import com.pulumi.aws.apigatewayv2.Integration;
import com.pulumi.aws.apigatewayv2.IntegrationArgs;
import com.pulumi.asset.FileArchive;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleFunction = new Function("exampleFunction", FunctionArgs.builder()
.code(new FileArchive("example.zip"))
.role(aws_iam_role.example().arn())
.handler("index.handler")
.runtime("nodejs16.x")
.build());
var exampleIntegration = new Integration("exampleIntegration", IntegrationArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.integrationType("AWS_PROXY")
.connectionType("INTERNET")
.contentHandlingStrategy("CONVERT_TO_TEXT")
.description("Lambda example")
.integrationMethod("POST")
.integrationUri(exampleFunction.invokeArn())
.passthroughBehavior("WHEN_NO_MATCH")
.build());
}
}

AWS Service Integration

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Integration;
import com.pulumi.aws.apigatewayv2.IntegrationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Integration("example", IntegrationArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.credentialsArn(aws_iam_role.example().arn())
.description("SQS example")
.integrationType("AWS_PROXY")
.integrationSubtype("SQS-SendMessage")
.requestParameters(Map.ofEntries(
Map.entry("QueueUrl", "$request.header.queueUrl"),
Map.entry("MessageBody", "$request.body.message")
))
.build());
}
}

Private Integration

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Integration;
import com.pulumi.aws.apigatewayv2.IntegrationArgs;
import com.pulumi.aws.apigatewayv2.inputs.IntegrationTlsConfigArgs;
import com.pulumi.aws.apigatewayv2.inputs.IntegrationResponseParameterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Integration("example", IntegrationArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.credentialsArn(aws_iam_role.example().arn())
.description("Example with a load balancer")
.integrationType("HTTP_PROXY")
.integrationUri(aws_lb_listener.example().arn())
.integrationMethod("ANY")
.connectionType("VPC_LINK")
.connectionId(aws_apigatewayv2_vpc_link.example().id())
.tlsConfig(IntegrationTlsConfigArgs.builder()
.serverNameToVerify("example.com")
.build())
.requestParameters(Map.ofEntries(
Map.entry("append:header.authforintegration", "$context.authorizer.authorizerResponse"),
Map.entry("overwrite:path", "staticValueForIntegration")
))
.responseParameters(
IntegrationResponseParameterArgs.builder()
.statusCode(403)
.mappings(Map.of("append:header.auth", "$context.authorizer.authorizerResponse"))
.build(),
IntegrationResponseParameterArgs.builder()
.statusCode(200)
.mappings(Map.of("overwrite:statuscode", "204"))
.build())
.build());
}
}

Import

aws_apigatewayv2_integration can be imported by using the API identifier and integration identifier, e.g.,

$ pulumi import aws:apigatewayv2/integration:Integration example aabbccddee/1122334

Constructors

Link copied to clipboard
constructor(apiId: Output<String>? = null, connectionId: Output<String>? = null, connectionType: Output<String>? = null, contentHandlingStrategy: Output<String>? = null, credentialsArn: Output<String>? = null, description: Output<String>? = null, integrationMethod: Output<String>? = null, integrationSubtype: Output<String>? = null, integrationType: Output<String>? = null, integrationUri: Output<String>? = null, passthroughBehavior: Output<String>? = null, payloadFormatVersion: Output<String>? = null, requestParameters: Output<Map<String, String>>? = null, requestTemplates: Output<Map<String, String>>? = null, responseParameters: Output<List<IntegrationResponseParameterArgs>>? = null, templateSelectionExpression: Output<String>? = null, timeoutMilliseconds: Output<Int>? = null, tlsConfig: Output<IntegrationTlsConfigArgs>? = null)

Properties

Link copied to clipboard
val apiId: Output<String>? = null

API identifier.

Link copied to clipboard
val connectionId: Output<String>? = null

ID of the VPC link for a private integration. Supported only for HTTP APIs. Must be between 1 and 1024 characters in length.

Link copied to clipboard
val connectionType: Output<String>? = null

Type of the network connection to the integration endpoint. Valid values: INTERNET, VPC_LINK. Default is INTERNET.

Link copied to clipboard
val contentHandlingStrategy: Output<String>? = null

How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT. Supported only for WebSocket APIs.

Link copied to clipboard
val credentialsArn: Output<String>? = null

Credentials required for the integration, if any.

Link copied to clipboard
val description: Output<String>? = null

Description of the integration.

Link copied to clipboard
val integrationMethod: Output<String>? = null

Integration's HTTP method. Must be specified if integration_type is not MOCK.

Link copied to clipboard
val integrationSubtype: Output<String>? = null

AWS service action to invoke. Supported only for HTTP APIs when integration_type is AWS_PROXY. See the AWS service integration reference documentation for supported values. Must be between 1 and 128 characters in length.

Link copied to clipboard
val integrationType: Output<String>? = null

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.

Link copied to clipboard
val integrationUri: Output<String>? = null

URI of the Lambda function for a Lambda proxy integration, when integration_type 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.

Link copied to clipboard
val passthroughBehavior: Output<String>? = null

Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the request_templates attribute. Valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, NEVER. Default is WHEN_NO_MATCH. Supported only for WebSocket APIs.

Link copied to clipboard
val payloadFormatVersion: Output<String>? = null

The format of the payload sent to an integration. Valid values: 1.0, 2.0. Default is 1.0.

Link copied to clipboard
val requestParameters: Output<Map<String, String>>? = null

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 integration_subtype, a key-value map specifying parameters that are passed to AWS_PROXY integrations. For HTTP APIs without a specified integration_subtype, a key-value map specifying how to transform HTTP requests before sending them to the backend. See the Amazon API Gateway Developer Guide for details.

Link copied to clipboard
val requestTemplates: Output<Map<String, String>>? = null

Map of Velocity 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.

Link copied to clipboard

Mappings to transform the HTTP response from a backend integration before returning the response to clients. Supported only for HTTP APIs.

Link copied to clipboard
val templateSelectionExpression: Output<String>? = null

The template selection expression for the integration.

Link copied to clipboard
val timeoutMilliseconds: Output<Int>? = null

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.

Link copied to clipboard
val tlsConfig: Output<IntegrationTlsConfigArgs>? = null

TLS configuration for a private integration. Supported only for HTTP APIs.

Functions

Link copied to clipboard
open override fun toJava(): IntegrationArgs