@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
227 lines (226 loc) • 9.73 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { RestApi } from "./index";
/**
* 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 `dependsOn` for clean runs.
*
* ## Example Usage
*
* ```typescript
* 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
*
* Using `pulumi import`, import `aws_api_gateway_integration_response` using `REST-API-ID/RESOURCE-ID/HTTP-METHOD/STATUS-CODE`. For example:
*
* ```sh
* $ pulumi import aws:apigateway/integrationResponse:IntegrationResponse example 12345abcde/67890fghij/GET/200
* ```
*/
export declare class IntegrationResponse extends pulumi.CustomResource {
/**
* Get an existing IntegrationResponse resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: IntegrationResponseState, opts?: pulumi.CustomResourceOptions): IntegrationResponse;
/**
* Returns true if the given object is an instance of IntegrationResponse. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is IntegrationResponse;
/**
* 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.
*/
readonly contentHandling: pulumi.Output<string | undefined>;
/**
* HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`).
*/
readonly httpMethod: pulumi.Output<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* API resource ID.
*/
readonly resourceId: pulumi.Output<string>;
/**
* Map of response parameters that can be read from the backend response. For example: `responseParameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
*/
readonly responseParameters: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Map of templates used to transform the integration response body.
*/
readonly responseTemplates: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* ID of the associated REST API.
*/
readonly restApi: pulumi.Output<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.
*/
readonly selectionPattern: pulumi.Output<string | undefined>;
/**
* HTTP status code.
*
* The following arguments are optional:
*/
readonly statusCode: pulumi.Output<string>;
/**
* Create a IntegrationResponse resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: IntegrationResponseArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering IntegrationResponse resources.
*/
export interface IntegrationResponseState {
/**
* 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.
*/
contentHandling?: pulumi.Input<string>;
/**
* HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`).
*/
httpMethod?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* API resource ID.
*/
resourceId?: pulumi.Input<string>;
/**
* Map of response parameters that can be read from the backend response. For example: `responseParameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
*/
responseParameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Map of templates used to transform the integration response body.
*/
responseTemplates?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* ID of the associated REST API.
*/
restApi?: pulumi.Input<string | RestApi>;
/**
* 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.
*/
selectionPattern?: pulumi.Input<string>;
/**
* HTTP status code.
*
* The following arguments are optional:
*/
statusCode?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a IntegrationResponse resource.
*/
export interface IntegrationResponseArgs {
/**
* 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.
*/
contentHandling?: pulumi.Input<string>;
/**
* HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`).
*/
httpMethod: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* API resource ID.
*/
resourceId: pulumi.Input<string>;
/**
* Map of response parameters that can be read from the backend response. For example: `responseParameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`.
*/
responseParameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Map of templates used to transform the integration response body.
*/
responseTemplates?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* ID of the associated REST API.
*/
restApi: pulumi.Input<string | RestApi>;
/**
* 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.
*/
selectionPattern?: pulumi.Input<string>;
/**
* HTTP status code.
*
* The following arguments are optional:
*/
statusCode: pulumi.Input<string>;
}