provider/aws: Added API GW documentation regarding request/response templates (#11380)

* Added aws_api_gateway_integration request_templates in the documentation

* Added aws_api_gateway_integration_response response_templates in the documentation
This commit is contained in:
Gauthier Wallet 2017-01-24 15:06:26 +01:00 committed by Paul Stack
parent 02e72de975
commit 6d026b1893
2 changed files with 20 additions and 0 deletions

View File

@ -36,6 +36,15 @@ resource "aws_api_gateway_integration" "MyDemoIntegration" {
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
type = "MOCK"
# Transforms the incoming XML request to JSON
request_templates {
"application/xml" = <<EOF
{
"body" : $input.json('$')
}
EOF
}
}
```

View File

@ -53,6 +53,17 @@ resource "aws_api_gateway_integration_response" "MyDemoIntegrationResponse" {
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
status_code = "${aws_api_gateway_method_response.200.status_code}"
# Transforms the backend JSON response to XML
response_templates {
"application/xml" = <<EOF
#set($inputRoot = $input.path('$'))
<?xml version="1.0" encoding="UTF-8"?>
<message>
$inputRoot.body
</message>
EOF
}
}
```