We're trying to recreate our API Gateway with Terraform 0.6.16, but we're having some issues with the aws_api_gateway_integration resource, and it's not entirely clear if these qualify as bugs, missing features, or lack of understanding a somewhat non-obvious problem.
resource "aws_api_gateway_integration" "<xxx>_post_integration" {
rest_api_id = "${aws_api_gateway_rest_api.<api_name>.id}"
resource_id = "${aws_api_gateway_resource.<resource_name>.id}"
http_method = "${aws_api_gateway_method.<method_name>.http_method}"
type = "AWS"
uri = "arn:aws:apigateway:${var.region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${var.region}:<account_id>:function:<function_name>/invocations"
credentials = "arn:aws:iam::<account_id>:role/<role_name>"
integration_http_method = "POST"
request_templates = {
"application/x-www-form-urlencoded" = "{ \"body\": $input.json(\"$\") }"
}
request_parameters_in_json = <<PARAMS
{
"X-Amz-Invocation-Type": "Event"
}
PARAMS
}aws_api_gateway_integration.<resource_name>: Error creating API Gateway Integration: BadRequestException: Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: Event, Invalid mapping expression specified: X-Amz-Invocation-Type]
status code: 400, request id: <request_id>
?Ω