terraform aws apigateway path_part - amazon-web-services

I was trying one POC in the below scenario using was terraform api_gateway.
path= /demo/user(GET) -> invoke lamda function (hello).
path= /demo/user/{id)(put) -> invoke lamda function (test).
so here i have create the below resource
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
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 = "demo"
}
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 = "AWS_PROXY"
uri = "<lambda function arn>/invocation"
}
in terraform apply it is creating resource under /demo
but here how do I achieve the path?
path= /demo/user(GET) -> invoke lamda function (hello).
path= /demo/user/{id)(PUT) -> invoke lamda function (test).
Any comment will be highly appreciated.

For /demo/user (GET), you need to create resource 'user' under 'demo' and add integration for 'user' resource. For /demo/user/{id} (PUT), you need to create another resource 'userId' under 'user' and add integration for 'userId' resource.
Http methods and Lambda integrations must be added for both of them using corresponding Lambda functions.
Updated code would be something like below.
# root resource
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
# demo resource (corresponding to path /demo)
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 = "demo"
}
# user resource (corresponding to path /demo/user)
resource "aws_api_gateway_resource" "MyDemoUserResource" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
parent_id = aws_api_gateway_resource.MyDemoResource.id
path_part = "user"
}
# adding GET method for path /demo/user
resource "aws_api_gateway_method" "MyDemoUserGetMethod" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_resource.MyDemoUserResource.id
http_method = "GET"
authorization = "NONE"
}
# userId resource (corresponding to path /demo/user/{id})
resource "aws_api_gateway_resource" "MyDemoUserIdResource" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
parent_id = aws_api_gateway_resource.MyDemoUserResource.id
path_part = "{id}"
}
# adding PUT method for path /demo/user/{id}
resource "aws_api_gateway_method" "MyDemoUserIdPutMethod" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_resource.MyDemoUserIdResource.id
http_method = "PUT"
authorization = "NONE"
}
# adding Lambda integration for GET at /demo/user
resource "aws_api_gateway_integration" "MyDemoUserIntegration" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_resource.MyDemoUserResource.id
http_method = aws_api_gateway_method.MyDemoUserGetMethod.http_method
type = "AWS_PROXY"
uri = "<lambda function arn>/invocation"
}
# adding Lambda integration for PUT at /demo/user/{id}
resource "aws_api_gateway_integration" "MyDemoUserIdIntegration" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_resource.MyDemoUserIdResource.id
http_method = aws_api_gateway_method.MyDemoUserIdPutMethod.http_method
type = "AWS_PROXY"
uri = "<lambda function arn>/invocation"
}
References
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_integration#lambda-integration
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_rest_api#terraform-resources

Related

Terraform Include parent uri with dynamic parameter in child uri for AWS API Gateway

I want to create a endpoint like user/<user_id>/info through aws_api_gateway using terraform
I am able to create endpoint till /user/<user_id>
But how to include <user_id> in the resource for "info"
Here is the code for "info" part:
resource "aws_api_gateway_resource" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
parent_id = aws_api_gateway_resource.user.id
path_part = "info"
}
resource "aws_api_gateway_method" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = "GET"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = aws_api_gateway_method.info.http_method
type = "HTTP_PROXY"
uri = "http://root_api/user/<user_id>/info"
When I try this, the url for info resolves to http://root_api/user/<user_id>/info.
Any help on how to inject <user_id> in this url ??
Thanks
Terraform interpolates variables in strings: documentation.
In your case:
uri = "http://root_api/user/${aws_api_gateway_resource.user.id}/info"
Figured Out the answer. This makes you accept any dynamic parameter into your integation uri no matter from where they appear in the ancestor chain
resource "aws_api_gateway_resource" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
parent_id = aws_api_gateway_resource.user.id
path_part = "info"
}
resource "aws_api_gateway_method" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = "GET"
authorization = "NONE"
request_parameters =
{
"method.request.path.user_id" = true
}
}
resource "aws_api_gateway_integration" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = aws_api_gateway_method.info.http_method
type = "HTTP_PROXY"
uri = "http://root_api/user/<user_id>/info"
request_parameters =
{
"integration.request.path.user_id" = "method.request.path.user_id"
}
}

Enable caching for url query parameters in aws api gateway with terraform

resource "aws_api_gateway_method" "MyDemoMethod" {
rest_api_id = aws_api_gateway_rest_api.example.id
resource_id = aws_api_gateway_resource.MyDemoResource.id
http_method = "ANY"
authorization = "NONE"
request_parameters = {
"method.request.path.proxy" = true
"method.request.querystring.tableid" = true
}
}
With this script, I am trying to add a URL query parameter named tableid with caching enabled. But I can see no documentation referring to enabling the caching.
To do so, this can be done using cache_key_parameters and cache_namespace below the aws_api_gateway_integration as follows:
resource "aws_api_gateway_method" "MyDemoMethod" {
rest_api_id = aws_api_gateway_rest_api.example.id
resource_id = aws_api_gateway_resource.MyDemoResource.id
http_method = "ANY"
authorization = "NONE"
request_parameters = {
"method.request.path.proxy" = true
"method.request.querystring.tableid" = true
}
}
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"
cache_key_parameters = ["method.request.querystring.tableid"]
cache_namespace = "mycache"
}
This was introduced in this Pull Request https://github.com/hashicorp/terraform-provider-aws/pull/893.

Terraform add aws_api_gateway_integration response json

I need help to configure the post methods as lambda type without proxy and the 200 response type application / json => Empty
This is my Terraform file at aws, I'm new to Terraform, it just lacked this configuration to work if someone can help me.
I'm having an error response in terraform apply
Error creating API Gateway Integration Response: NotFoundException: Invalid Integration identifier specified Error creating API Gateway Deployment: BadRequestException: No integration defined for method
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "stone-test"
billing_mode = "PROVISIONED"
read_capacity = 20
write_capacity = 20
hash_key = "id"
attribute {
name = "id"
type = "N"
}
ttl {
attribute_name = "TimeToExist"
enabled = false
}
tags = {
Name = "dynamodb-table-1"
Environment = "dev"
}
}
resource "aws_iam_role_policy" "lambda_policy" {
name = "lambda_policy"
role = aws_iam_role.role_for_LDC.id
policy = file("policy.json")
}
resource "aws_iam_role" "role_for_LDC" {
name = "myrole"
assume_role_policy = file("assume_role_policy.json")
}
resource "aws_lambda_function" "stone_register2" {
filename = "stone_register.zip"
function_name = "stone_register3"
role = aws_iam_role.role_for_LDC.arn
handler = "stone_register.lambda_handler"
# The filebase64sha256() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
# source_code_hash = "${base64sha256(file("stone_register.zip"))}"
source_code_hash = filebase64sha256("stone_register.zip")
runtime = "python3.6"
environment {
variables = {
DB_TABLE_NAME = "stone-test"
}
}
}
resource "aws_lambda_function" "stone_delete2" {
filename = "stone_delete.zip"
function_name = "stone_delete3"
role = aws_iam_role.role_for_LDC.arn
handler = "stone_delete.lambda_handler"
# The filebase64sha256() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
# source_code_hash = "${base64sha256(file("stone_delete.zip"))}"
source_code_hash = filebase64sha256("stone_delete.zip")
runtime = "python3.6"
environment {
variables = {
DB_TABLE_NAME = "stone-test"
}
}
}
resource "aws_lambda_function" "stone_search2" {
filename = "stone_search.zip"
function_name = "stone_search3"
role = aws_iam_role.role_for_LDC.arn
handler = "stone_search.lambda_handler"
# The filebase64sha256() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
# source_code_hash = "${base64sha256(file("stone_search.zip"))}"
source_code_hash = filebase64sha256("stone_search.zip")
runtime = "python3.6"
environment {
variables = {
DB_TABLE_NAME = "stone-test"
}
}
}
resource "aws_lambda_function" "stone2" {
filename = "bot.zip"
function_name = "stone3"
role = aws_iam_role.role_for_LDC.arn
handler = "bot.lambda_handler"
# The filebase64sha256() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
# source_code_hash = "${base64sha256(file("bot.zip"))}"
source_code_hash = filebase64sha256("bot.zip")
runtime = "python3.6"
environment {
variables = {
DB_TABLE_NAME = "stone-test"
}
}
}
resource "aws_api_gateway_rest_api" "apiLambda" {
name = "myAPI"
}
resource "aws_api_gateway_resource" "Resource" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
parent_id = aws_api_gateway_rest_api.apiLambda.root_resource_id
path_part = "bot"
}
resource "aws_api_gateway_method" "Method" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource.id
http_method = "POST"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "lambdaInt" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource.id
http_method = aws_api_gateway_method.Method.http_method
integration_http_method = "POST"
type = "AWS"
uri = aws_lambda_function.stone2.invoke_arn
}
resource "aws_api_gateway_method_response" "response_200" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource.id
http_method = aws_api_gateway_method.Method.http_method
status_code = "200"
}
resource "aws_api_gateway_integration_response" "MyDemoIntegrationResponse" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource.id
http_method = aws_api_gateway_method.Method.http_method
status_code = aws_api_gateway_method_response.response_200.status_code
}
resource "aws_api_gateway_resource" "Resource2" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
parent_id = aws_api_gateway_rest_api.apiLambda.root_resource_id
path_part = "register"
}
resource "aws_api_gateway_method" "Method2" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource2.id
http_method = "POST"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "lambdaInt2" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource2.id
http_method = aws_api_gateway_method.Method2.http_method
integration_http_method = "POST"
type = "AWS_PROXY"
uri = aws_lambda_function.stone_register2.invoke_arn
}
resource "aws_api_gateway_resource" "Resource3" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
parent_id = aws_api_gateway_rest_api.apiLambda.root_resource_id
path_part = "delete"
}
resource "aws_api_gateway_method" "Method3" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource3.id
http_method = "POST"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "lambdaInt3" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource3.id
http_method = aws_api_gateway_method.Method3.http_method
integration_http_method = "POST"
type = "AWS_PROXY"
uri = aws_lambda_function.stone_delete2.invoke_arn
}
resource "aws_api_gateway_resource" "Resource4" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
parent_id = aws_api_gateway_rest_api.apiLambda.root_resource_id
path_part = "search"
}
resource "aws_api_gateway_method" "Method4" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource4.id
http_method = "POST"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "lambdaInt4" {
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
resource_id = aws_api_gateway_resource.Resource4.id
http_method = aws_api_gateway_method.Method4.http_method
integration_http_method = "POST"
type = "AWS_PROXY"
uri = aws_lambda_function.stone_search2.invoke_arn
}
resource "aws_api_gateway_deployment" "apideploy" {
depends_on = [aws_api_gateway_integration.lambdaInt]
rest_api_id = aws_api_gateway_rest_api.apiLambda.id
stage_name = "Prod"
}
resource "aws_lambda_permission" "apigw" {
statement_id = "AllowExecutionFromAPIGateway"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.stone2.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.apiLambda.execution_arn}/Prod/POST/bot"
}
resource "aws_lambda_permission" "apigw2" {
statement_id = "AllowExecutionFromAPIGateway"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.stone_register2.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.apiLambda.execution_arn}/Prod/POST/register"
}
resource "aws_lambda_permission" "apigw3" {
statement_id = "AllowExecutionFromAPIGateway"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.stone_delete2.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.apiLambda.execution_arn}/Prod/POST/delete"
}
resource "aws_lambda_permission" "apigw4" {
statement_id = "AllowExecutionFromAPIGateway"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.stone_search2.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.apiLambda.execution_arn}/Prod/POST/search"
}
output "base_url" {
value = aws_api_gateway_deployment.apideploy.invoke_url
}
You are already on the correct path, all you need to do create the method_response and use the same for creating the integration_response
And change the integration type
There is a comprehensive list of the types and what they can do and how can you leverage them in documentation
I only adjusted a few settings in the code you shared, which are below:
...
resource "aws_api_gateway_integration" "integration" {
rest_api_id = aws_api_gateway_rest_api.api.id
resource_id = aws_api_gateway_resource.resource.id
http_method = aws_api_gateway_method.method.http_method
integration_http_method = "POST"
type = "AWS"
uri = aws_lambda_function.lambda.invoke_arn
}
....
resource "aws_api_gateway_method_response" "response_200" {
rest_api_id = aws_api_gateway_rest_api.api.id
resource_id = aws_api_gateway_resource.resource.id
http_method = aws_api_gateway_method.method.http_method
status_code = "200"
}
resource "aws_api_gateway_integration_response" "MyDemoIntegrationResponse" {
rest_api_id = aws_api_gateway_rest_api.api.id
resource_id = aws_api_gateway_resource.resource.id
http_method = aws_api_gateway_method.method.http_method
status_code = aws_api_gateway_method_response.response_200.status_code
}
when I test the function from the AWS console I get the following:

How do I get resource path for Root Resource in ApiGateway?

I am trying to change cache settings in api gateway for GET/OPTIONS methods of root resource using terraform.
resource "aws_api_gateway_method_settings" "root_get_method_settings" {
rest_api_id = aws_api_gateway_rest_api.default.id
stage_name = terraform.workspace
method_path = "<root resource path>/GET"
settings {
metrics_enabled = true
logging_level = "INFO"
caching_enabled = true
}
}
I am getting issue on method_path argument since I couldn't figure out correct value for <root resource path>.
method_path for any other resources like {proxy+} resource looks like below:
resource "aws_api_gateway_method_settings" "proxy_get_method_settings" {
rest_api_id = aws_api_gateway_rest_api.default.id
stage_name = terraform.workspace
method_path = "{proxy+}/GET"
}
The path is "~1/GET". Below is full working example:
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_method" "MyDemoMethod" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_rest_api.MyDemoAPI.root_resource_id
http_method = "GET"
authorization = "NONE"
}
resource "aws_api_gateway_deployment" "test" {
depends_on = [aws_api_gateway_integration.test]
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
stage_name = "prod"
}
resource "aws_api_gateway_integration" "test" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
resource_id = aws_api_gateway_rest_api.MyDemoAPI.root_resource_id
http_method = aws_api_gateway_method.MyDemoMethod.http_method
type = "MOCK"
}
resource "aws_api_gateway_method_settings" "root_get_method_settings" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
stage_name = "prod"
method_path = "~1/GET"
settings {
metrics_enabled = true
logging_level = "INFO"
caching_enabled = true
}
depends_on = [aws_api_gateway_deployment.test]
}

How do I create an API Proxy using Terraform and AWS API Gateway

I am trying to use Terraform to be able to stand up a simple API Proxy in API Gateway on AWS. Basically, I want to wrap root and proxy the requests back to another end point. Its probably the simplest setup and I can't seem to get it to work in Terraform.
Below you will find the script. At this point I am able to create the REST API, define a Resource, create a method but there doesn't seem to be any way to define it the end-point.
provider "aws" {
region = "us-east-1"
}
resource "aws_api_gateway_rest_api" "TerraTest" {
name = "TerraTest"
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_resource" "TerraProxyResource" {
rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
parent_id = "${aws_api_gateway_rest_api.TerraTest.root_resource_id}"
path_part = "{proxy+}"
}
resource "aws_api_gateway_integration" "integration" {
rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
resource_id = "${aws_api_gateway_resource.TerraProxyResource.id}"
http_method = "${aws_api_gateway_method.mymethod.http_method}"
type = "HTTP_PROXY"
uri = "http://api.endpoint.com/{proxy+}"
}
Here I set the type to proxy, but I don't think URI is the right property for setting the endpoint.
resource "aws_api_gateway_method" "mymethod" {
rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
resource_id = "${aws_api_gateway_resource.TerraProxyResource.id}"
http_method = "ANY"
authorization = "NONE"
}
I expect somewhere here to be able to create that mapping to some other endpoint, but there doesn't appear to be any properties for that. (https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_api_gateway_method.go)
resource "aws_api_gateway_api_key" "TerraTestKey" {
name = "Terra_Test_Key"
stage_key {
rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
stage_name = "${aws_api_gateway_deployment.TerraTestDeployment.stage_name}"
}
}
resource "aws_api_gateway_deployment" "TerraTestDeployment" {
rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
stage_name = "dev"
}
I scanned the source code and I didn't see any properties that I can set.
Can anyone share any advice/snipets?
Tim
Ps. If you want to try to run the script yourself, I put it here: http://textuploader.com/d14sx
This is the relevant module which shows a working solution. It doesn't stand alone since it relies on some variables defined elsewhere but it should be enough to help anyone struggling to get a AWS Proxy setup and also shows Lambda authorizer integration as a bonus.
provider "aws" {
region = "${var.region}"
profile = "${var.profile}"
}
data "aws_iam_role" "api_user" {
role_name = "api_user"
}
module "authorizer_lambda" {
source = "../lambda"
name = "${var.api_name}-authorizer_lambda"
filename = "authorizer_lambda"
runtime = "nodejs4.3"
role = "${data.aws_iam_role.api_user.arn}"
}
resource "aws_api_gateway_authorizer" "custom_authorizer" {
name = "${var.api_name}-custom_authorizer"
rest_api_id = "${aws_api_gateway_rest_api.ApiGateway.id}"
authorizer_uri = "${module.authorizer_lambda.uri}"
authorizer_credentials = "${data.aws_iam_role.api_user.arn}"
authorizer_result_ttl_in_seconds = 1
}
resource "aws_api_gateway_rest_api" "ApiGateway" {
name = "${var.api_name}"
description = "${var.api_description}"
}
resource "aws_api_gateway_resource" "ApiProxyResource" {
rest_api_id = "${aws_api_gateway_rest_api.ApiGateway.id}"
parent_id = "${aws_api_gateway_rest_api.ApiGateway.root_resource_id}"
path_part = "{proxy+}"
}
resource "aws_api_gateway_integration" "ApiProxyIntegration" {
rest_api_id = "${aws_api_gateway_rest_api.ApiGateway.id}"
resource_id = "${aws_api_gateway_resource.ApiProxyResource.id}"
http_method = "${aws_api_gateway_method.ApiProxyMethod.http_method}"
type = "HTTP_PROXY"
integration_http_method = "ANY"
uri = "${format("%s/{proxy}", "${var.base_url}")}"
passthrough_behavior = "WHEN_NO_MATCH"
request_parameters = "${var.aws_api_gateway_integration_request_parameters}"
}
resource "aws_api_gateway_method" "ApiProxyMethod" {
rest_api_id = "${aws_api_gateway_rest_api.ApiGateway.id}"
resource_id = "${aws_api_gateway_resource.ApiProxyResource.id}"
http_method = "ANY"
authorization = "CUSTOM"
authorizer_id = "${aws_api_gateway_authorizer.custom_authorizer.id}"
request_parameters = {"method.request.path.proxy" = true}
}
resource "aws_api_gateway_deployment" "ApiDeployment" {
depends_on = ["aws_api_gateway_method.ApiProxyMethod"]
rest_api_id = "${aws_api_gateway_rest_api.ApiGateway.id}"
stage_name = "${var.stage_name}"
}