1. Packages
  2. AWS Classic
  3. API Docs
  4. apigateway
  5. IntegrationResponse

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.apigateway.IntegrationResponse

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const myDemoAPI = new aws.apigateway.RestApi("MyDemoAPI", {
        name: "MyDemoAPI",
        description: "This is my API for demonstration purposes",
    });
    const myDemoResource = new aws.apigateway.Resource("MyDemoResource", {
        restApi: myDemoAPI.id,
        parentId: myDemoAPI.rootResourceId,
        pathPart: "mydemoresource",
    });
    const myDemoMethod = new aws.apigateway.Method("MyDemoMethod", {
        restApi: myDemoAPI.id,
        resourceId: myDemoResource.id,
        httpMethod: "GET",
        authorization: "NONE",
    });
    const myDemoIntegration = new aws.apigateway.Integration("MyDemoIntegration", {
        restApi: myDemoAPI.id,
        resourceId: myDemoResource.id,
        httpMethod: myDemoMethod.httpMethod,
        type: "MOCK",
    });
    const response200 = new aws.apigateway.MethodResponse("response_200", {
        restApi: myDemoAPI.id,
        resourceId: myDemoResource.id,
        httpMethod: myDemoMethod.httpMethod,
        statusCode: "200",
    });
    const myDemoIntegrationResponse = new aws.apigateway.IntegrationResponse("MyDemoIntegrationResponse", {
        restApi: myDemoAPI.id,
        resourceId: myDemoResource.id,
        httpMethod: myDemoMethod.httpMethod,
        statusCode: response200.statusCode,
        responseTemplates: {
            "application/xml": `#set($inputRoot = $input.path('$'))
    <?xml version="1.0" encoding="UTF-8"?>
    <message>
        $inputRoot.body
    </message>
    `,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    my_demo_api = aws.apigateway.RestApi("MyDemoAPI",
        name="MyDemoAPI",
        description="This is my API for demonstration purposes")
    my_demo_resource = aws.apigateway.Resource("MyDemoResource",
        rest_api=my_demo_api.id,
        parent_id=my_demo_api.root_resource_id,
        path_part="mydemoresource")
    my_demo_method = aws.apigateway.Method("MyDemoMethod",
        rest_api=my_demo_api.id,
        resource_id=my_demo_resource.id,
        http_method="GET",
        authorization="NONE")
    my_demo_integration = aws.apigateway.Integration("MyDemoIntegration",
        rest_api=my_demo_api.id,
        resource_id=my_demo_resource.id,
        http_method=my_demo_method.http_method,
        type="MOCK")
    response200 = aws.apigateway.MethodResponse("response_200",
        rest_api=my_demo_api.id,
        resource_id=my_demo_resource.id,
        http_method=my_demo_method.http_method,
        status_code="200")
    my_demo_integration_response = aws.apigateway.IntegrationResponse("MyDemoIntegrationResponse",
        rest_api=my_demo_api.id,
        resource_id=my_demo_resource.id,
        http_method=my_demo_method.http_method,
        status_code=response200.status_code,
        response_templates={
            "application/xml": """#set($inputRoot = $input.path('$'))
    <?xml version="1.0" encoding="UTF-8"?>
    <message>
        $inputRoot.body
    </message>
    """,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myDemoAPI, err := apigateway.NewRestApi(ctx, "MyDemoAPI", &apigateway.RestApiArgs{
    			Name:        pulumi.String("MyDemoAPI"),
    			Description: pulumi.String("This is my API for demonstration purposes"),
    		})
    		if err != nil {
    			return err
    		}
    		myDemoResource, err := apigateway.NewResource(ctx, "MyDemoResource", &apigateway.ResourceArgs{
    			RestApi:  myDemoAPI.ID(),
    			ParentId: myDemoAPI.RootResourceId,
    			PathPart: pulumi.String("mydemoresource"),
    		})
    		if err != nil {
    			return err
    		}
    		myDemoMethod, err := apigateway.NewMethod(ctx, "MyDemoMethod", &apigateway.MethodArgs{
    			RestApi:       myDemoAPI.ID(),
    			ResourceId:    myDemoResource.ID(),
    			HttpMethod:    pulumi.String("GET"),
    			Authorization: pulumi.String("NONE"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apigateway.NewIntegration(ctx, "MyDemoIntegration", &apigateway.IntegrationArgs{
    			RestApi:    myDemoAPI.ID(),
    			ResourceId: myDemoResource.ID(),
    			HttpMethod: myDemoMethod.HttpMethod,
    			Type:       pulumi.String("MOCK"),
    		})
    		if err != nil {
    			return err
    		}
    		response200, err := apigateway.NewMethodResponse(ctx, "response_200", &apigateway.MethodResponseArgs{
    			RestApi:    myDemoAPI.ID(),
    			ResourceId: myDemoResource.ID(),
    			HttpMethod: myDemoMethod.HttpMethod,
    			StatusCode: pulumi.String("200"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apigateway.NewIntegrationResponse(ctx, "MyDemoIntegrationResponse", &apigateway.IntegrationResponseArgs{
    			RestApi:    myDemoAPI.ID(),
    			ResourceId: myDemoResource.ID(),
    			HttpMethod: myDemoMethod.HttpMethod,
    			StatusCode: response200.StatusCode,
    			ResponseTemplates: pulumi.StringMap{
    				"application/xml": pulumi.String(`#set($inputRoot = $input.path('$'))
    <?xml version="1.0" encoding="UTF-8"?>
    <message>
        $inputRoot.body
    </message>
    `),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var myDemoAPI = new Aws.ApiGateway.RestApi("MyDemoAPI", new()
        {
            Name = "MyDemoAPI",
            Description = "This is my API for demonstration purposes",
        });
    
        var myDemoResource = new Aws.ApiGateway.Resource("MyDemoResource", new()
        {
            RestApi = myDemoAPI.Id,
            ParentId = myDemoAPI.RootResourceId,
            PathPart = "mydemoresource",
        });
    
        var myDemoMethod = new Aws.ApiGateway.Method("MyDemoMethod", new()
        {
            RestApi = myDemoAPI.Id,
            ResourceId = myDemoResource.Id,
            HttpMethod = "GET",
            Authorization = "NONE",
        });
    
        var myDemoIntegration = new Aws.ApiGateway.Integration("MyDemoIntegration", new()
        {
            RestApi = myDemoAPI.Id,
            ResourceId = myDemoResource.Id,
            HttpMethod = myDemoMethod.HttpMethod,
            Type = "MOCK",
        });
    
        var response200 = new Aws.ApiGateway.MethodResponse("response_200", new()
        {
            RestApi = myDemoAPI.Id,
            ResourceId = myDemoResource.Id,
            HttpMethod = myDemoMethod.HttpMethod,
            StatusCode = "200",
        });
    
        var myDemoIntegrationResponse = new Aws.ApiGateway.IntegrationResponse("MyDemoIntegrationResponse", new()
        {
            RestApi = myDemoAPI.Id,
            ResourceId = myDemoResource.Id,
            HttpMethod = myDemoMethod.HttpMethod,
            StatusCode = response200.StatusCode,
            ResponseTemplates = 
            {
                { "application/xml", @"#set($inputRoot = $input.path('$'))
    <?xml version=""1.0"" encoding=""UTF-8""?>
    <message>
        $inputRoot.body
    </message>
    " },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.apigateway.RestApi;
    import com.pulumi.aws.apigateway.RestApiArgs;
    import com.pulumi.aws.apigateway.Resource;
    import com.pulumi.aws.apigateway.ResourceArgs;
    import com.pulumi.aws.apigateway.Method;
    import com.pulumi.aws.apigateway.MethodArgs;
    import com.pulumi.aws.apigateway.Integration;
    import com.pulumi.aws.apigateway.IntegrationArgs;
    import com.pulumi.aws.apigateway.MethodResponse;
    import com.pulumi.aws.apigateway.MethodResponseArgs;
    import com.pulumi.aws.apigateway.IntegrationResponse;
    import com.pulumi.aws.apigateway.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 myDemoAPI = new RestApi("myDemoAPI", RestApiArgs.builder()        
                .name("MyDemoAPI")
                .description("This is my API for demonstration purposes")
                .build());
    
            var myDemoResource = new Resource("myDemoResource", ResourceArgs.builder()        
                .restApi(myDemoAPI.id())
                .parentId(myDemoAPI.rootResourceId())
                .pathPart("mydemoresource")
                .build());
    
            var myDemoMethod = new Method("myDemoMethod", MethodArgs.builder()        
                .restApi(myDemoAPI.id())
                .resourceId(myDemoResource.id())
                .httpMethod("GET")
                .authorization("NONE")
                .build());
    
            var myDemoIntegration = new Integration("myDemoIntegration", IntegrationArgs.builder()        
                .restApi(myDemoAPI.id())
                .resourceId(myDemoResource.id())
                .httpMethod(myDemoMethod.httpMethod())
                .type("MOCK")
                .build());
    
            var response200 = new MethodResponse("response200", MethodResponseArgs.builder()        
                .restApi(myDemoAPI.id())
                .resourceId(myDemoResource.id())
                .httpMethod(myDemoMethod.httpMethod())
                .statusCode("200")
                .build());
    
            var myDemoIntegrationResponse = new IntegrationResponse("myDemoIntegrationResponse", IntegrationResponseArgs.builder()        
                .restApi(myDemoAPI.id())
                .resourceId(myDemoResource.id())
                .httpMethod(myDemoMethod.httpMethod())
                .statusCode(response200.statusCode())
                .responseTemplates(Map.of("application/xml", """
    #set($inputRoot = $input.path('$'))
    <?xml version="1.0" encoding="UTF-8"?>
    <message>
        $inputRoot.body
    </message>
                """))
                .build());
    
        }
    }
    
    resources:
      myDemoAPI:
        type: aws:apigateway:RestApi
        name: MyDemoAPI
        properties:
          name: MyDemoAPI
          description: This is my API for demonstration purposes
      myDemoResource:
        type: aws:apigateway:Resource
        name: MyDemoResource
        properties:
          restApi: ${myDemoAPI.id}
          parentId: ${myDemoAPI.rootResourceId}
          pathPart: mydemoresource
      myDemoMethod:
        type: aws:apigateway:Method
        name: MyDemoMethod
        properties:
          restApi: ${myDemoAPI.id}
          resourceId: ${myDemoResource.id}
          httpMethod: GET
          authorization: NONE
      myDemoIntegration:
        type: aws:apigateway:Integration
        name: MyDemoIntegration
        properties:
          restApi: ${myDemoAPI.id}
          resourceId: ${myDemoResource.id}
          httpMethod: ${myDemoMethod.httpMethod}
          type: MOCK
      response200:
        type: aws:apigateway:MethodResponse
        name: response_200
        properties:
          restApi: ${myDemoAPI.id}
          resourceId: ${myDemoResource.id}
          httpMethod: ${myDemoMethod.httpMethod}
          statusCode: '200'
      myDemoIntegrationResponse:
        type: aws:apigateway:IntegrationResponse
        name: MyDemoIntegrationResponse
        properties:
          restApi: ${myDemoAPI.id}
          resourceId: ${myDemoResource.id}
          httpMethod: ${myDemoMethod.httpMethod}
          statusCode: ${response200.statusCode}
          responseTemplates:
            application/xml: |
              #set($inputRoot = $input.path('$'))
              <?xml version="1.0" encoding="UTF-8"?>
              <message>
                  $inputRoot.body
              </message>          
    

    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,
                            http_method: Optional[str] = None,
                            resource_id: Optional[str] = None,
                            rest_api: Optional[str] = None,
                            status_code: Optional[str] = None,
                            content_handling: Optional[str] = None,
                            response_parameters: Optional[Mapping[str, str]] = None,
                            response_templates: Optional[Mapping[str, str]] = None,
                            selection_pattern: 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:apigateway:IntegrationResponse
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args IntegrationResponseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args IntegrationResponseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IntegrationResponseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IntegrationResponseArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var integrationResponseResource = new Aws.ApiGateway.IntegrationResponse("integrationResponseResource", new()
    {
        HttpMethod = "string",
        ResourceId = "string",
        RestApi = "string",
        StatusCode = "string",
        ContentHandling = "string",
        ResponseParameters = 
        {
            { "string", "string" },
        },
        ResponseTemplates = 
        {
            { "string", "string" },
        },
        SelectionPattern = "string",
    });
    
    example, err := apigateway.NewIntegrationResponse(ctx, "integrationResponseResource", &apigateway.IntegrationResponseArgs{
    	HttpMethod:      pulumi.String("string"),
    	ResourceId:      pulumi.String("string"),
    	RestApi:         pulumi.Any("string"),
    	StatusCode:      pulumi.String("string"),
    	ContentHandling: pulumi.String("string"),
    	ResponseParameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ResponseTemplates: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	SelectionPattern: pulumi.String("string"),
    })
    
    var integrationResponseResource = new IntegrationResponse("integrationResponseResource", IntegrationResponseArgs.builder()        
        .httpMethod("string")
        .resourceId("string")
        .restApi("string")
        .statusCode("string")
        .contentHandling("string")
        .responseParameters(Map.of("string", "string"))
        .responseTemplates(Map.of("string", "string"))
        .selectionPattern("string")
        .build());
    
    integration_response_resource = aws.apigateway.IntegrationResponse("integrationResponseResource",
        http_method="string",
        resource_id="string",
        rest_api="string",
        status_code="string",
        content_handling="string",
        response_parameters={
            "string": "string",
        },
        response_templates={
            "string": "string",
        },
        selection_pattern="string")
    
    const integrationResponseResource = new aws.apigateway.IntegrationResponse("integrationResponseResource", {
        httpMethod: "string",
        resourceId: "string",
        restApi: "string",
        statusCode: "string",
        contentHandling: "string",
        responseParameters: {
            string: "string",
        },
        responseTemplates: {
            string: "string",
        },
        selectionPattern: "string",
    });
    
    type: aws:apigateway:IntegrationResponse
    properties:
        contentHandling: string
        httpMethod: string
        resourceId: string
        responseParameters:
            string: string
        responseTemplates:
            string: string
        restApi: string
        selectionPattern: string
        statusCode: string
    

    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

    The IntegrationResponse resource accepts the following input properties:

    HttpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    ResourceId string
    API resource ID.
    RestApi string | string
    ID of the associated REST API.
    StatusCode string

    HTTP status code.

    The following arguments are optional:

    ContentHandling string
    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.
    ResponseParameters Dictionary<string, string>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    ResponseTemplates Dictionary<string, string>
    Map of templates used to transform the integration response body.
    SelectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    HttpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    ResourceId string
    API resource ID.
    RestApi string | string
    ID of the associated REST API.
    StatusCode string

    HTTP status code.

    The following arguments are optional:

    ContentHandling string
    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.
    ResponseParameters map[string]string
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    ResponseTemplates map[string]string
    Map of templates used to transform the integration response body.
    SelectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    httpMethod String
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId String
    API resource ID.
    restApi String | String
    ID of the associated REST API.
    statusCode String

    HTTP status code.

    The following arguments are optional:

    contentHandling String
    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.
    responseParameters Map<String,String>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates Map<String,String>
    Map of templates used to transform the integration response body.
    selectionPattern String
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    httpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId string
    API resource ID.
    restApi string | RestApi
    ID of the associated REST API.
    statusCode string

    HTTP status code.

    The following arguments are optional:

    contentHandling string
    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.
    responseParameters {[key: string]: string}
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates {[key: string]: string}
    Map of templates used to transform the integration response body.
    selectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    http_method str
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resource_id str
    API resource ID.
    rest_api str | str
    ID of the associated REST API.
    status_code str

    HTTP status code.

    The following arguments are optional:

    content_handling str
    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.
    response_parameters Mapping[str, str]
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    response_templates Mapping[str, str]
    Map of templates used to transform the integration response body.
    selection_pattern str
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    httpMethod String
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId String
    API resource ID.
    restApi String |
    ID of the associated REST API.
    statusCode String

    HTTP status code.

    The following arguments are optional:

    contentHandling String
    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.
    responseParameters Map<String>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates Map<String>
    Map of templates used to transform the integration response body.
    selectionPattern String
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.

    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,
            content_handling: Optional[str] = None,
            http_method: Optional[str] = None,
            resource_id: Optional[str] = None,
            response_parameters: Optional[Mapping[str, str]] = None,
            response_templates: Optional[Mapping[str, str]] = None,
            rest_api: Optional[str] = None,
            selection_pattern: Optional[str] = None,
            status_code: 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)
    Resource lookup is not supported in YAML
    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.
    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:
    ContentHandling string
    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.
    HttpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    ResourceId string
    API resource ID.
    ResponseParameters Dictionary<string, string>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    ResponseTemplates Dictionary<string, string>
    Map of templates used to transform the integration response body.
    RestApi string | string
    ID of the associated REST API.
    SelectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    StatusCode string

    HTTP status code.

    The following arguments are optional:

    ContentHandling string
    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.
    HttpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    ResourceId string
    API resource ID.
    ResponseParameters map[string]string
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    ResponseTemplates map[string]string
    Map of templates used to transform the integration response body.
    RestApi string | string
    ID of the associated REST API.
    SelectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    StatusCode string

    HTTP status code.

    The following arguments are optional:

    contentHandling String
    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.
    httpMethod String
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId String
    API resource ID.
    responseParameters Map<String,String>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates Map<String,String>
    Map of templates used to transform the integration response body.
    restApi String | String
    ID of the associated REST API.
    selectionPattern String
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    statusCode String

    HTTP status code.

    The following arguments are optional:

    contentHandling string
    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.
    httpMethod string
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId string
    API resource ID.
    responseParameters {[key: string]: string}
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates {[key: string]: string}
    Map of templates used to transform the integration response body.
    restApi string | RestApi
    ID of the associated REST API.
    selectionPattern string
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    statusCode string

    HTTP status code.

    The following arguments are optional:

    content_handling str
    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.
    http_method str
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resource_id str
    API resource ID.
    response_parameters Mapping[str, str]
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    response_templates Mapping[str, str]
    Map of templates used to transform the integration response body.
    rest_api str | str
    ID of the associated REST API.
    selection_pattern str
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    status_code str

    HTTP status code.

    The following arguments are optional:

    contentHandling String
    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.
    httpMethod String
    HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY).
    resourceId String
    API resource ID.
    responseParameters Map<String>
    Map of response parameters that can be read from the backend response. For example: response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }.
    responseTemplates Map<String>
    Map of templates used to transform the integration response body.
    restApi String |
    ID of the associated REST API.
    selectionPattern String
    Regular expression pattern used to choose an integration response based on the response from the backend. Omit configuring this to make 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.
    statusCode String

    HTTP status code.

    The following arguments are optional:

    Import

    Using pulumi import, import aws_api_gateway_integration_response using REST-API-ID/RESOURCE-ID/HTTP-METHOD/STATUS-CODE. For example:

    $ pulumi import aws:apigateway/integrationResponse:IntegrationResponse example 12345abcde/67890fghij/GET/200
    

    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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi