github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/api_gateway_method_response.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_api_gateway_method_response"
     4  sidebar_current: "docs-aws-resource-api-gateway-method-response"
     5  description: |-
     6    Provides an HTTP Method Response for an API Gateway Resource.
     7  ---
     8  
     9  # aws\_api\_gateway\_method\_response
    10  
    11  Provides an HTTP Method Response for an API Gateway Resource.
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "aws_api_gateway_rest_api" "MyDemoAPI" {
    17    name        = "MyDemoAPI"
    18    description = "This is my API for demonstration purposes"
    19  }
    20  
    21  resource "aws_api_gateway_resource" "MyDemoResource" {
    22    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    23    parent_id   = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}"
    24    path_part   = "mydemoresource"
    25  }
    26  
    27  resource "aws_api_gateway_method" "MyDemoMethod" {
    28    rest_api_id   = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    29    resource_id   = "${aws_api_gateway_resource.MyDemoResource.id}"
    30    http_method   = "GET"
    31    authorization = "NONE"
    32  }
    33  
    34  resource "aws_api_gateway_integration" "MyDemoIntegration" {
    35    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    36    resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
    37    http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
    38    type        = "MOCK"
    39  }
    40  
    41  resource "aws_api_gateway_method_response" "200" {
    42    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    43    resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
    44    http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
    45    status_code = "200"
    46  }
    47  ```
    48  
    49  ## Argument Reference
    50  
    51  The following arguments are supported:
    52  
    53  * `rest_api_id` - (Required) The ID of the associated REST API
    54  * `resource_id` - (Required) The API resource ID
    55  * `http_method` - (Required) The HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`)
    56  * `status_code` - (Required) The HTTP status code
    57  * `response_models` - (Optional) A map of the API models used for the response's content type
    58  * `response_parameters` - (Optional) A map of response parameters that can be sent to the caller.
    59     For example: `response_parameters = { "method.response.header.X-Some-Header" = true }`
    60     would define that the header `X-Some-Header` can be provided on the response.
    61  * `response_parameters_in_json` - **Deprecated**, use `response_parameters` instead.