Class IntegrationResponse
Provides an HTTP Method Integration Response for an API Gateway Resource.
Note: Depends on having
aws.apigateway.Integrationinside your rest api. To ensure this you might need to add an explicitdepends_onfor 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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class IntegrationResponse : CustomResource
Constructors
View SourceIntegrationResponse(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 SourceContentHandling
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> |
HttpMethod
The HTTP method (GET, POST, PUT, DELETE, HEAD, OPTIONS, ANY)
Declaration
public Output<string> HttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceId
The API resource ID
Declaration
public Output<string> ResourceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResponseParameters
A 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" }
Declaration
public Output<ImmutableDictionary<string, string>> ResponseParameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
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>> |
RestApi
The ID of the associated REST API
Declaration
public Output<string> RestApi { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
StatusCode
The HTTP status code
Declaration
public Output<string> StatusCode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |