Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/softprops/action-g…
Browse files Browse the repository at this point in the history
…h-release-2
  • Loading branch information
walteck authored Oct 22, 2024
2 parents 3c837ed + 628291d commit 6a8f68f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ click==8.1.7
Flask-WTF==1.2.0
Flask==2.3.3
itsdangerous==2.1.2
Jinja2==3.1.2
Jinja2==3.1.3
MarkupSafe==2.1.3
pip==23.1.2
setuptools==65.5.1
Expand Down
11 changes: 10 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ resource "aws_lambda_function" "get_method_lambda" {
variables = var.lambda_environment_variables
}
}

dynamic "vpc_config" {
for_each = length(keys(var.lambda_vpc_config)) == 0 ? [] : [true]
content {
subnet_ids = var.lambda_vpc_config.subnet_ids
security_group_ids = var.lambda_vpc_config.security_group_ids
}
}

}

resource "aws_cloudwatch_log_group" "get_method_lambda_log_group" {
Expand All @@ -59,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 = "GET /"
route_key = "${var.api_route_method} ${var.api_route_path}"
target = "integrations/${aws_apigatewayv2_integration.get_method_lambda_integration.id}"
}

Expand Down
25 changes: 25 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,28 @@ variable "log_retention_days" {
description = "The number of days to retain log events in the CloudWatch Logs Log Group."
default = 14
}

variable "lambda_vpc_config" {
description = "VPC configuration for the Lambda function."
type = object({
security_group_ids = list(string)
subnet_ids = list(string)
})
default = {
security_group_ids = []
subnet_ids = []
}
}

variable "api_route_method" {
description = "The route method 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 6a8f68f

Please sign in to comment.