Skip to content

Commit

Permalink
Added better route variables
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanibn-nasar1-nhs committed Oct 18, 2024
1 parent 089dff1 commit eb8ca00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

Expand Down
9 changes: 8 additions & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/"

}

0 comments on commit eb8ca00

Please sign in to comment.