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
new Integration(name: string, args: IntegrationArgs, opts?: CustomResourceOptions);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:
- Api
Id string The API identifier.
- Integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- Connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- Connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- Content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- Credentials
Arn string The credentials required for the integration, if any.
- Description string
The description of the integration.
- Integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- Integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- Payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- Request
Templates 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.
- Template
Selection stringExpression The template selection expression for the integration.
- Timeout
Milliseconds int Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
- Api
Id string The API identifier.
- Integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- Connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- Connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- Content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- Credentials
Arn string The credentials required for the integration, if any.
- Description string
The description of the integration.
- Integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- Integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- Payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- Request
Templates 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.
- Template
Selection stringExpression The template selection expression for the integration.
- Timeout
Milliseconds int Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
- api
Id string The API identifier.
- integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- credentials
Arn string The credentials required for the integration, if any.
- description string
The description of the integration.
- integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- request
Templates {[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.
- template
Selection stringExpression The template selection expression for the integration.
- timeout
Milliseconds 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 isINTERNET.- content_
handling_ strstrategy 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_typeis notMOCK.- integration_
uri str The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- payload_
format_ strversion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.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_ strexpression 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.
- Integration
Response stringSelection Expression The integration response selection expression for the integration.
- Id string
- The provider-assigned unique ID for this managed resource.
- Integration
Response stringSelection Expression The integration response selection expression for the integration.
- id string
- The provider-assigned unique ID for this managed resource.
- integration
Response stringSelection Expression The integration response selection expression for the integration.
- id str
- The provider-assigned unique ID for this managed resource.
- integration_
response_ strselection_ expression 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): Integrationstatic 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:
- Api
Id string The API identifier.
- Connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- Connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- Content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- Credentials
Arn string The credentials required for the integration, if any.
- Description string
The description of the integration.
- Integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- Integration
Response stringSelection Expression The integration response selection expression for the integration.
- Integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- Integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- Payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- Request
Templates 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.
- Template
Selection stringExpression The template selection expression for the integration.
- Timeout
Milliseconds int Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
- Api
Id string The API identifier.
- Connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- Connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- Content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- Credentials
Arn string The credentials required for the integration, if any.
- Description string
The description of the integration.
- Integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- Integration
Response stringSelection Expression The integration response selection expression for the integration.
- Integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- Integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- Payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- Request
Templates 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.
- Template
Selection stringExpression The template selection expression for the integration.
- Timeout
Milliseconds int Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
- api
Id string The API identifier.
- connection
Id string The ID of the VPC link for a private integration. Supported only for HTTP APIs.
- connection
Type string The type of the network connection to the integration endpoint. Valid values:
INTERNET,VPC_LINK. Default isINTERNET.- content
Handling stringStrategy How to handle response payload content type conversions. Valid values:
CONVERT_TO_BINARY,CONVERT_TO_TEXT. Supported only for WebSocket APIs.- credentials
Arn string The credentials required for the integration, if any.
- description string
The description of the integration.
- integration
Method string The integration’s HTTP method. Must be specified if
integration_typeis notMOCK.- integration
Response stringSelection Expression The integration response selection expression for the integration.
- integration
Type string The integration type of an integration. Valid values:
AWS,AWS_PROXY,HTTP,HTTP_PROXY,MOCK.- integration
Uri string The URI of the Lambda function for a Lambda proxy integration, when
integration_typeisAWS_PROXY. For anHTTPintegration, 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 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- payload
Format stringVersion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.0.- request
Templates {[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.
- template
Selection stringExpression The template selection expression for the integration.
- timeout
Milliseconds 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 isINTERNET.- content_
handling_ strstrategy 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_typeis notMOCK.- integration_
response_ strselection_ expression 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_typeisAWS_PROXY. For anHTTPintegration, 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_templatesattribute. Valid values:WHEN_NO_MATCH,WHEN_NO_TEMPLATES,NEVER. Default isWHEN_NO_MATCH. Supported only for WebSocket APIs.- payload_
format_ strversion The format of the payload sent to an integration. Valid values:
1.0,2.0. Default is1.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_ strexpression 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
awsTerraform Provider.