From eb8ca00ac7ea02e68cd5268dd7b79536c1901722 Mon Sep 17 00:00:00 2001 From: amaanibn-nasar1-nhs Date: Fri, 18 Oct 2024 11:13:47 +0100 Subject: [PATCH] Added better route variables --- terraform/main.tf | 2 +- terraform/variables.tf | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index fc419bb..f64bb70 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -68,7 +68,7 @@ resource "aws_apigatewayv2_integration" "get_method_lambda_integration" { resource "aws_apigatewayv2_route" "get_method_route" { api_id = aws_apigatewayv2_api.get_method_api.id - route_key = "${var.api_route} /" + route_key = "${var.api_route_method} ${var.api_route_path}" target = "integrations/${aws_apigatewayv2_integration.get_method_lambda_integration.id}" } diff --git a/terraform/variables.tf b/terraform/variables.tf index 7887790..c958119 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -81,8 +81,15 @@ variable "lambda_vpc_config" { } } -variable "api_route" { +variable "api_route_method" { description = "The route for the API Gateway." type = string default = "GET" } + +variable "api_route_path" { + description = "The path for the API Gateway." + type = string + default = "/" + +}