Update aws api gateway docs to add some examples (#7586)

* added aws api gateway docs request parameter examples; fixed deployment example

* update aws api gw deployment docs to add depends on
pull/7685/head
Matthew Clarke 10 years ago committed by Radek Simko
parent b8d21330a7
commit 9dbf998d23

@ -21,23 +21,31 @@ resource "aws_api_gateway_rest_api" "MyDemoAPI" {
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_resource" "test" {
resource "aws_api_gateway_resource" "MyDemoResource" {
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
parent_id = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}"
path_part = "test"
}
resource "aws_api_gateway_method" "test" {
resource "aws_api_gateway_method" "MyDemoMethod" {
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
resource_id = "${aws_api_gateway_resource.test.id}"
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
http_method = "GET"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "MyDemoIntegration" {
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
type = "MOCK"
}
resource "aws_api_gateway_deployment" "MyDemoDeployment" {
depends_on = ["aws_api_gateway_integration.test"]
depends_on = ["aws_api_gateway_method.MyDemoMethod"]
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
stage_name = "test"
variables = {
"answer" = "42"

@ -58,4 +58,6 @@ The following arguments are supported:
* `request_templates` - (Optional) A map of the integration's request templates.
* `request_parameters_in_json` - (Optional) A map written as a JSON string specifying
the request query string parameters and headers that should be passed to the
backend responder
backend responder.
For example: `request_parameters_in_json = "{\"integration.request.header.X-Some-Other-Header\":\"method.request.header.X-Some-Header\"}"`
would add the header `X-Some-Header` from method to the integration as the header `X-Some-Other-Header`.

@ -67,3 +67,5 @@ The following arguments are supported:
For all other `HTTP` and `AWS` backends, the HTTP status code is matched.
* `response_templates` - (Optional) A map specifying the templates used to transform the integration response body
* `response_parameters_in_json` - (Optional) A map written as JSON string specifying response parameters that can be read from the backend response
For example: `response_parameters_in_json = "{\"method.response.header.X-Some-Header\":\"integration.response.header.X-Some-Other-Header\"}"`,
would add the header `X-Some-Other-Header` from the integration response to the method response as the header `X-Some-Header`.

@ -46,3 +46,5 @@ The following arguments are supported:
and value is either `Error`, `Empty` (built-in models) or `aws_api_gateway_model`'s `name`.
* `request_parameters_in_json` - (Optional) A map written as a JSON string specifying
the request query string parameters and headers that should be passed to the integration
For example: `request_parameters_in_json = "{\"method.request.header.X-Some-Header\":true}"`
would define that the header X-Some-Header must be provided on the request.

@ -56,3 +56,5 @@ The following arguments are supported:
* `status_code` - (Required) The HTTP status code
* `response_models` - (Optional) A map of the API models used for the response's content type
* `response_parameters_in_json` - (Optional) A map written as a JSON string representing response parameters that can be sent to the caller
For example: `response_parameters_in_json = "{\"method.response.header.X-Some-Header\":true}"`
would define that the header X-Some-Header can be provided on the response.

Loading…
Cancel
Save