From 9dbf998d2359e3edbf46ba609bd5cbbb4f0f9f56 Mon Sep 17 00:00:00 2001 From: Matthew Clarke Date: Mon, 18 Jul 2016 09:37:39 +0100 Subject: [PATCH] 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 --- .../aws/r/api_gateway_deployment.html.markdown | 16 ++++++++++++---- .../aws/r/api_gateway_integration.html.markdown | 4 +++- ...pi_gateway_integration_response.html.markdown | 2 ++ .../aws/r/api_gateway_method.html.markdown | 2 ++ .../r/api_gateway_method_response.html.markdown | 2 ++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/website/source/docs/providers/aws/r/api_gateway_deployment.html.markdown b/website/source/docs/providers/aws/r/api_gateway_deployment.html.markdown index 5be552d83f..9068a2d194 100644 --- a/website/source/docs/providers/aws/r/api_gateway_deployment.html.markdown +++ b/website/source/docs/providers/aws/r/api_gateway_deployment.html.markdown @@ -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" diff --git a/website/source/docs/providers/aws/r/api_gateway_integration.html.markdown b/website/source/docs/providers/aws/r/api_gateway_integration.html.markdown index fc36efcc07..b6704bb74b 100644 --- a/website/source/docs/providers/aws/r/api_gateway_integration.html.markdown +++ b/website/source/docs/providers/aws/r/api_gateway_integration.html.markdown @@ -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`. diff --git a/website/source/docs/providers/aws/r/api_gateway_integration_response.html.markdown b/website/source/docs/providers/aws/r/api_gateway_integration_response.html.markdown index bf65d27714..1db32a92ad 100644 --- a/website/source/docs/providers/aws/r/api_gateway_integration_response.html.markdown +++ b/website/source/docs/providers/aws/r/api_gateway_integration_response.html.markdown @@ -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`. diff --git a/website/source/docs/providers/aws/r/api_gateway_method.html.markdown b/website/source/docs/providers/aws/r/api_gateway_method.html.markdown index 54e15183b2..87221b65af 100644 --- a/website/source/docs/providers/aws/r/api_gateway_method.html.markdown +++ b/website/source/docs/providers/aws/r/api_gateway_method.html.markdown @@ -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. diff --git a/website/source/docs/providers/aws/r/api_gateway_method_response.html.markdown b/website/source/docs/providers/aws/r/api_gateway_method_response.html.markdown index 2704c07c48..d1bc4f9c0c 100644 --- a/website/source/docs/providers/aws/r/api_gateway_method_response.html.markdown +++ b/website/source/docs/providers/aws/r/api_gateway_method_response.html.markdown @@ -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.