1. Packages
  2. AWS
  3. API Docs
  4. apigatewayv2
  5. IntegrationResponse
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.apigatewayv2.IntegrationResponse

Explore with Pulumi AI

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

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigatewayv2.IntegrationResponse("example", {
    apiId: exampleAwsApigatewayv2Api.id,
    integrationId: exampleAwsApigatewayv2Integration.id,
    integrationResponseKey: "/200/",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.IntegrationResponse("example",
    api_id=example_aws_apigatewayv2_api["id"],
    integration_id=example_aws_apigatewayv2_integration["id"],
    integration_response_key="/200/")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigatewayv2.NewIntegrationResponse(ctx, "example", &apigatewayv2.IntegrationResponseArgs{
			ApiId:                  pulumi.Any(exampleAwsApigatewayv2Api.Id),
			IntegrationId:          pulumi.Any(exampleAwsApigatewayv2Integration.Id),
			IntegrationResponseKey: pulumi.String("/200/"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.ApiGatewayV2.IntegrationResponse("example", new()
    {
        ApiId = exampleAwsApigatewayv2Api.Id,
        IntegrationId = exampleAwsApigatewayv2Integration.Id,
        IntegrationResponseKey = "/200/",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.IntegrationResponse;
import com.pulumi.aws.apigatewayv2.IntegrationResponseArgs;
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 IntegrationResponse("example", IntegrationResponseArgs.builder()
            .apiId(exampleAwsApigatewayv2Api.id())
            .integrationId(exampleAwsApigatewayv2Integration.id())
            .integrationResponseKey("/200/")
            .build());

    }
}
Copy
resources:
  example:
    type: aws:apigatewayv2:IntegrationResponse
    properties:
      apiId: ${exampleAwsApigatewayv2Api.id}
      integrationId: ${exampleAwsApigatewayv2Integration.id}
      integrationResponseKey: /200/
Copy

Create IntegrationResponse Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new IntegrationResponse(name: string, args: IntegrationResponseArgs, opts?: CustomResourceOptions);
@overload
def IntegrationResponse(resource_name: str,
                        args: IntegrationResponseArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def IntegrationResponse(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        api_id: Optional[str] = None,
                        integration_id: Optional[str] = None,
                        integration_response_key: Optional[str] = None,
                        content_handling_strategy: Optional[str] = None,
                        response_templates: Optional[Mapping[str, str]] = None,
                        template_selection_expression: Optional[str] = None)
func NewIntegrationResponse(ctx *Context, name string, args IntegrationResponseArgs, opts ...ResourceOption) (*IntegrationResponse, error)
public IntegrationResponse(string name, IntegrationResponseArgs args, CustomResourceOptions? opts = null)
public IntegrationResponse(String name, IntegrationResponseArgs args)
public IntegrationResponse(String name, IntegrationResponseArgs args, CustomResourceOptions options)
type: aws:apigatewayv2:IntegrationResponse
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. IntegrationResponseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. IntegrationResponseArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. IntegrationResponseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. IntegrationResponseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IntegrationResponseArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsIntegrationResponseResource = new Aws.ApiGatewayV2.IntegrationResponse("awsIntegrationResponseResource", new()
{
    ApiId = "string",
    IntegrationId = "string",
    IntegrationResponseKey = "string",
    ContentHandlingStrategy = "string",
    ResponseTemplates = 
    {
        { "string", "string" },
    },
    TemplateSelectionExpression = "string",
});
Copy
example, err := apigatewayv2.NewIntegrationResponse(ctx, "awsIntegrationResponseResource", &apigatewayv2.IntegrationResponseArgs{
	ApiId:                   pulumi.String("string"),
	IntegrationId:           pulumi.String("string"),
	IntegrationResponseKey:  pulumi.String("string"),
	ContentHandlingStrategy: pulumi.String("string"),
	ResponseTemplates: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	TemplateSelectionExpression: pulumi.String("string"),
})
Copy
var awsIntegrationResponseResource = new IntegrationResponse("awsIntegrationResponseResource", IntegrationResponseArgs.builder()
    .apiId("string")
    .integrationId("string")
    .integrationResponseKey("string")
    .contentHandlingStrategy("string")
    .responseTemplates(Map.of("string", "string"))
    .templateSelectionExpression("string")
    .build());
Copy
aws_integration_response_resource = aws.apigatewayv2.IntegrationResponse("awsIntegrationResponseResource",
    api_id="string",
    integration_id="string",
    integration_response_key="string",
    content_handling_strategy="string",
    response_templates={
        "string": "string",
    },
    template_selection_expression="string")
Copy
const awsIntegrationResponseResource = new aws.apigatewayv2.IntegrationResponse("awsIntegrationResponseResource", {
    apiId: "string",
    integrationId: "string",
    integrationResponseKey: "string",
    contentHandlingStrategy: "string",
    responseTemplates: {
        string: "string",
    },
    templateSelectionExpression: "string",
});
Copy
type: aws:apigatewayv2:IntegrationResponse
properties:
    apiId: string
    contentHandlingStrategy: string
    integrationId: string
    integrationResponseKey: string
    responseTemplates:
        string: string
    templateSelectionExpression: string
Copy

IntegrationResponse Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The IntegrationResponse resource accepts the following input properties:

ApiId
This property is required.
Changes to this property will trigger replacement.
string
API identifier.
IntegrationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the aws.apigatewayv2.Integration.
IntegrationResponseKey This property is required. string
Integration response key.
ContentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
ResponseTemplates Dictionary<string, string>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
TemplateSelectionExpression string
The template selection expression for the integration response.
ApiId
This property is required.
Changes to this property will trigger replacement.
string
API identifier.
IntegrationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the aws.apigatewayv2.Integration.
IntegrationResponseKey This property is required. string
Integration response key.
ContentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
ResponseTemplates map[string]string
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
TemplateSelectionExpression string
The template selection expression for the integration response.
apiId
This property is required.
Changes to this property will trigger replacement.
String
API identifier.
integrationId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey This property is required. String
Integration response key.
contentHandlingStrategy String
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
responseTemplates Map<String,String>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression String
The template selection expression for the integration response.
apiId
This property is required.
Changes to this property will trigger replacement.
string
API identifier.
integrationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey This property is required. string
Integration response key.
contentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
responseTemplates {[key: string]: string}
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression string
The template selection expression for the integration response.
api_id
This property is required.
Changes to this property will trigger replacement.
str
API identifier.
integration_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier of the aws.apigatewayv2.Integration.
integration_response_key This property is required. str
Integration response key.
content_handling_strategy str
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
response_templates Mapping[str, str]
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
template_selection_expression str
The template selection expression for the integration response.
apiId
This property is required.
Changes to this property will trigger replacement.
String
API identifier.
integrationId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey This property is required. String
Integration response key.
contentHandlingStrategy String
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
responseTemplates Map<String>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression String
The template selection expression for the integration response.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing IntegrationResponse Resource

Get an existing IntegrationResponse 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?: IntegrationResponseState, opts?: CustomResourceOptions): IntegrationResponse
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_id: Optional[str] = None,
        content_handling_strategy: Optional[str] = None,
        integration_id: Optional[str] = None,
        integration_response_key: Optional[str] = None,
        response_templates: Optional[Mapping[str, str]] = None,
        template_selection_expression: Optional[str] = None) -> IntegrationResponse
func GetIntegrationResponse(ctx *Context, name string, id IDInput, state *IntegrationResponseState, opts ...ResourceOption) (*IntegrationResponse, error)
public static IntegrationResponse Get(string name, Input<string> id, IntegrationResponseState? state, CustomResourceOptions? opts = null)
public static IntegrationResponse get(String name, Output<String> id, IntegrationResponseState state, CustomResourceOptions options)
resources:  _:    type: aws:apigatewayv2:IntegrationResponse    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
API identifier.
ContentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
IntegrationId Changes to this property will trigger replacement. string
Identifier of the aws.apigatewayv2.Integration.
IntegrationResponseKey string
Integration response key.
ResponseTemplates Dictionary<string, string>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
TemplateSelectionExpression string
The template selection expression for the integration response.
ApiId Changes to this property will trigger replacement. string
API identifier.
ContentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
IntegrationId Changes to this property will trigger replacement. string
Identifier of the aws.apigatewayv2.Integration.
IntegrationResponseKey string
Integration response key.
ResponseTemplates map[string]string
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
TemplateSelectionExpression string
The template selection expression for the integration response.
apiId Changes to this property will trigger replacement. String
API identifier.
contentHandlingStrategy String
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
integrationId Changes to this property will trigger replacement. String
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey String
Integration response key.
responseTemplates Map<String,String>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression String
The template selection expression for the integration response.
apiId Changes to this property will trigger replacement. string
API identifier.
contentHandlingStrategy string
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
integrationId Changes to this property will trigger replacement. string
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey string
Integration response key.
responseTemplates {[key: string]: string}
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression string
The template selection expression for the integration response.
api_id Changes to this property will trigger replacement. str
API identifier.
content_handling_strategy str
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
integration_id Changes to this property will trigger replacement. str
Identifier of the aws.apigatewayv2.Integration.
integration_response_key str
Integration response key.
response_templates Mapping[str, str]
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
template_selection_expression str
The template selection expression for the integration response.
apiId Changes to this property will trigger replacement. String
API identifier.
contentHandlingStrategy String
How to handle response payload content type conversions. Valid values: CONVERT_TO_BINARY, CONVERT_TO_TEXT.
integrationId Changes to this property will trigger replacement. String
Identifier of the aws.apigatewayv2.Integration.
integrationResponseKey String
Integration response key.
responseTemplates Map<String>
Map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client.
templateSelectionExpression String
The template selection expression for the integration response.

Import

Using pulumi import, import aws_apigatewayv2_integration_response using the API identifier, integration identifier and integration response identifier. For example:

$ pulumi import aws:apigatewayv2/integrationResponse:IntegrationResponse example aabbccddee/1122334/998877
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.