Integration

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

Example Usage

Basic

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.ApiGatewayV2.Integration("example", new Aws.ApiGatewayV2.IntegrationArgs
        {
            ApiId = aws_apigatewayv2_api.Example.Id,
            IntegrationType = "MOCK",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigatewayv2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := apigatewayv2.NewIntegration(ctx, "example", &apigatewayv2.IntegrationArgs{
            ApiId:           pulumi.String(aws_apigatewayv2_api.Example.Id),
            IntegrationType: pulumi.String("MOCK"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.Integration("example",
    api_id=aws_apigatewayv2_api["example"]["id"],
    integration_type="MOCK")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigatewayv2.Integration("example", {
    apiId: aws_apigatewayv2_api_example.id,
    integrationType: "MOCK",
});

Lambda Integration

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleFunction = new Aws.Lambda.Function("exampleFunction", new Aws.Lambda.FunctionArgs
        {
            Code = new FileArchive("example.zip"),
            Handler = "index.handler",
            Role = aws_iam_role.Example.Arn,
            Runtime = "nodejs10.x",
        });
        var exampleIntegration = new Aws.ApiGatewayV2.Integration("exampleIntegration", new Aws.ApiGatewayV2.IntegrationArgs
        {
            ApiId = aws_apigatewayv2_api.Example.Id,
            ConnectionType = "INTERNET",
            ContentHandlingStrategy = "CONVERT_TO_TEXT",
            Description = "Lambda example",
            IntegrationMethod = "POST",
            IntegrationType = "AWS",
            IntegrationUri = exampleFunction.InvokeArn,
            PassthroughBehavior = "WHEN_NO_MATCH",
        });
    }

}

Coming soon!

import pulumi
import pulumi_aws as aws

example_function = aws.lambda_.Function("exampleFunction",
    code=pulumi.FileArchive("example.zip"),
    handler="index.handler",
    role=aws_iam_role["example"]["arn"],
    runtime="nodejs10.x")
example_integration = aws.apigatewayv2.Integration("exampleIntegration",
    api_id=aws_apigatewayv2_api["example"]["id"],
    connection_type="INTERNET",
    content_handling_strategy="CONVERT_TO_TEXT",
    description="Lambda example",
    integration_method="POST",
    integration_type="AWS",
    integration_uri=example_function.invoke_arn,
    passthrough_behavior="WHEN_NO_MATCH")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleFunction = new aws.lambda.Function("example", {
    code: new pulumi.asset.FileArchive("example.zip"),
    handler: "index.handler",
    role: aws_iam_role_example.arn,
    runtime: "nodejs10.x",
});
const exampleIntegration = new aws.apigatewayv2.Integration("example", {
    apiId: aws_apigatewayv2_api_example.id,
    connectionType: "INTERNET",
    contentHandlingStrategy: "CONVERT_TO_TEXT",
    description: "Lambda example",
    integrationMethod: "POST",
    integrationType: "AWS",
    integrationUri: exampleFunction.invokeArn,
    passthroughBehavior: "WHEN_NO_MATCH",
});

Create a Integration Resource

def Integration(resource_name, opts=None, api_id=None, connection_id=None, connection_type=None, content_handling_strategy=None, credentials_arn=None, description=None, integration_method=None, integration_type=None, integration_uri=None, passthrough_behavior=None, payload_format_version=None, request_templates=None, template_selection_expression=None, timeout_milliseconds=None, __props__=None);
func NewIntegration(ctx *Context, name string, args IntegrationArgs, opts ...ResourceOption) (*Integration, error)
public Integration(string name, IntegrationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args IntegrationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args IntegrationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IntegrationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Integration Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Integration resource accepts the following input properties:

ApiId string

The API identifier.

IntegrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

ConnectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

ConnectionType string

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

ContentHandlingStrategy string

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

CredentialsArn string

The credentials required for the integration, if any.

Description string

The description of the integration.

IntegrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

IntegrationUri string

The 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.

PassthroughBehavior string

The 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.

PayloadFormatVersion string

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

RequestTemplates Dictionary<string, string>

A 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.

TemplateSelectionExpression string

The template selection expression for the integration.

TimeoutMilliseconds int

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

ApiId string

The API identifier.

IntegrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

ConnectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

ConnectionType string

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

ContentHandlingStrategy string

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

CredentialsArn string

The credentials required for the integration, if any.

Description string

The description of the integration.

IntegrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

IntegrationUri string

The 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.

PassthroughBehavior string

The 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.

PayloadFormatVersion string

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

RequestTemplates map[string]string

A 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.

TemplateSelectionExpression string

The template selection expression for the integration.

TimeoutMilliseconds int

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

apiId string

The API identifier.

integrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

connectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

connectionType string

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

contentHandlingStrategy string

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

credentialsArn string

The credentials required for the integration, if any.

description string

The description of the integration.

integrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

integrationUri string

The 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.

passthroughBehavior string

The 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.

payloadFormatVersion string

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

requestTemplates {[key: string]: string}

A 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.

templateSelectionExpression string

The template selection expression for the integration.

timeoutMilliseconds number

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

api_id str

The API identifier.

integration_type str

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

connection_id str

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

connection_type str

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

content_handling_strategy str

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

credentials_arn str

The credentials required for the integration, if any.

description str

The description of the integration.

integration_method str

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

integration_uri str

The 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.

passthrough_behavior str

The 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.

payload_format_version str

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

request_templates Dict[str, str]

A 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.

template_selection_expression str

The template selection expression for the integration.

timeout_milliseconds float

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

Outputs

All input properties are implicitly available as output properties. Additionally, the Integration resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
IntegrationResponseSelectionExpression string

The integration response selection expression for the integration.

Id string
The provider-assigned unique ID for this managed resource.
IntegrationResponseSelectionExpression string

The integration response selection expression for the integration.

id string
The provider-assigned unique ID for this managed resource.
integrationResponseSelectionExpression string

The integration response selection expression for the integration.

id str
The provider-assigned unique ID for this managed resource.
integration_response_selection_expression str

The integration response selection expression for the integration.

Look up an Existing Integration Resource

Get an existing Integration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: IntegrationState, opts?: CustomResourceOptions): Integration
static get(resource_name, id, opts=None, api_id=None, connection_id=None, connection_type=None, content_handling_strategy=None, credentials_arn=None, description=None, integration_method=None, integration_response_selection_expression=None, integration_type=None, integration_uri=None, passthrough_behavior=None, payload_format_version=None, request_templates=None, template_selection_expression=None, timeout_milliseconds=None, __props__=None);
func GetIntegration(ctx *Context, name string, id IDInput, state *IntegrationState, opts ...ResourceOption) (*Integration, error)
public static Integration Get(string name, Input<string> id, IntegrationState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApiId string

The API identifier.

ConnectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

ConnectionType string

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

ContentHandlingStrategy string

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

CredentialsArn string

The credentials required for the integration, if any.

Description string

The description of the integration.

IntegrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

IntegrationResponseSelectionExpression string

The integration response selection expression for the integration.

IntegrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

IntegrationUri string

The 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.

PassthroughBehavior string

The 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.

PayloadFormatVersion string

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

RequestTemplates Dictionary<string, string>

A 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.

TemplateSelectionExpression string

The template selection expression for the integration.

TimeoutMilliseconds int

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

ApiId string

The API identifier.

ConnectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

ConnectionType string

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

ContentHandlingStrategy string

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

CredentialsArn string

The credentials required for the integration, if any.

Description string

The description of the integration.

IntegrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

IntegrationResponseSelectionExpression string

The integration response selection expression for the integration.

IntegrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

IntegrationUri string

The 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.

PassthroughBehavior string

The 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.

PayloadFormatVersion string

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

RequestTemplates map[string]string

A 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.

TemplateSelectionExpression string

The template selection expression for the integration.

TimeoutMilliseconds int

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

apiId string

The API identifier.

connectionId string

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

connectionType string

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

contentHandlingStrategy string

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

credentialsArn string

The credentials required for the integration, if any.

description string

The description of the integration.

integrationMethod string

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

integrationResponseSelectionExpression string

The integration response selection expression for the integration.

integrationType string

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

integrationUri string

The 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.

passthroughBehavior string

The 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.

payloadFormatVersion string

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

requestTemplates {[key: string]: string}

A 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.

templateSelectionExpression string

The template selection expression for the integration.

timeoutMilliseconds number

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

api_id str

The API identifier.

connection_id str

The ID of the VPC link for a private integration. Supported only for HTTP APIs.

connection_type str

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

content_handling_strategy str

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

credentials_arn str

The credentials required for the integration, if any.

description str

The description of the integration.

integration_method str

The integration’s HTTP method. Must be specified if integration_type is not MOCK.

integration_response_selection_expression str

The integration response selection expression for the integration.

integration_type str

The integration type of an integration. Valid values: AWS, AWS_PROXY, HTTP, HTTP_PROXY, MOCK.

integration_uri str

The 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.

passthrough_behavior str

The 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.

payload_format_version str

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

request_templates Dict[str, str]

A 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.

template_selection_expression str

The template selection expression for the integration.

timeout_milliseconds float

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.