Show / Hide Table of Contents

Class IntegrationResponse

Provides an HTTP Method Integration Response for an API Gateway Resource.

Note: Depends on having aws.apigateway.Integration inside your rest api. To ensure this you might need to add an explicit depends_on for clean runs.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var myDemoAPI = new Aws.ApiGateway.RestApi("myDemoAPI", new Aws.ApiGateway.RestApiArgs
    {
        Description = "This is my API for demonstration purposes",
    });
    var myDemoResource = new Aws.ApiGateway.Resource("myDemoResource", new Aws.ApiGateway.ResourceArgs
    {
        ParentId = myDemoAPI.RootResourceId,
        PathPart = "mydemoresource",
        RestApi = myDemoAPI.Id,
    });
    var myDemoMethod = new Aws.ApiGateway.Method("myDemoMethod", new Aws.ApiGateway.MethodArgs
    {
        Authorization = "NONE",
        HttpMethod = "GET",
        ResourceId = myDemoResource.Id,
        RestApi = myDemoAPI.Id,
    });
    var myDemoIntegration = new Aws.ApiGateway.Integration("myDemoIntegration", new Aws.ApiGateway.IntegrationArgs
    {
        HttpMethod = myDemoMethod.HttpMethod,
        ResourceId = myDemoResource.Id,
        RestApi = myDemoAPI.Id,
        Type = "MOCK",
    });
    var response200 = new Aws.ApiGateway.MethodResponse("response200", new Aws.ApiGateway.MethodResponseArgs
    {
        HttpMethod = myDemoMethod.HttpMethod,
        ResourceId = myDemoResource.Id,
        RestApi = myDemoAPI.Id,
        StatusCode = "200",
    });
    var myDemoIntegrationResponse = new Aws.ApiGateway.IntegrationResponse("myDemoIntegrationResponse", new Aws.ApiGateway.IntegrationResponseArgs
    {
        HttpMethod = myDemoMethod.HttpMethod,
        ResourceId = myDemoResource.Id,
        ResponseTemplates = 
        {
            { "application/xml", @"#set($$inputRoot = $$input.path('$$'))
<?xml version=""1.0"" encoding=""UTF-8""?>
<message>
$$inputRoot.body
</message>

" },
        },
        RestApi = myDemoAPI.Id,
        StatusCode = response200.StatusCode,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
IntegrationResponse
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class IntegrationResponse : CustomResource

Constructors

View Source

IntegrationResponse(String, IntegrationResponseArgs, CustomResourceOptions)

Create a IntegrationResponse resource with the given unique name, arguments, and options.

Declaration
public IntegrationResponse(string name, IntegrationResponseArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

IntegrationResponseArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ContentHandling

Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.

Declaration
public Output<string> ContentHandling { get; }
Property Value
Type Description
Output<System.String>
View Source

HttpMethod

The HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY)

Declaration
public Output<string> HttpMethod { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceId

The API resource ID

Declaration
public Output<string> ResourceId { get; }
Property Value
Type Description
Output<System.String>
View Source

ResponseParameters

A map of response parameters that can be read from the backend response. For example: response_parameters = { &quot;method.response.header.X-Some-Header&quot; = &quot;integration.response.header.X-Some-Other-Header&quot; }

Declaration
public Output<ImmutableDictionary<string, string>> ResponseParameters { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

ResponseTemplates

A map specifying the templates used to transform the integration response body

Declaration
public Output<ImmutableDictionary<string, string>> ResponseTemplates { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

RestApi

The ID of the associated REST API

Declaration
public Output<string> RestApi { get; }
Property Value
Type Description
Output<System.String>
View Source

SelectionPattern

Specifies the regular expression pattern used to choose an integration response based on the response from the backend. Setting this to - makes the integration the default one. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

Declaration
public Output<string> SelectionPattern { get; }
Property Value
Type Description
Output<System.String>
View Source

StatusCode

The HTTP status code

Declaration
public Output<string> StatusCode { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, IntegrationResponseState, CustomResourceOptions)

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

Declaration
public static IntegrationResponse Get(string name, Input<string> id, IntegrationResponseState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

IntegrationResponseState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
IntegrationResponse
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.