Skip to content

Commit

Permalink
make sure HOME is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengaDev committed Jun 22, 2024
1 parent 527636b commit ceec324
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion examples/basic-github-integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ module "spectral_lambda_integration" {
SHOULD_SKIP_INGEST = false
STRICT_MODE = false
SPECTRAL_TAGS = "iac,base,audit"
HOME = "/tmp"
}
}
2 changes: 2 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ locals {
}
# Please do not change or replace the 'frontend' suffix since there a logic in the bot based in it
api_triggered_function_name = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend"
# Merge user env vars with env vars which are not based on user input
env_vars = merge(var.env_vars, { HOME = "/tmp" })
}
2 changes: 1 addition & 1 deletion modules/lambda/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "aws_lambda_function" "spectral_scanner_lambda" {
)

environment {
variables = var.env_vars
variables = local.env_vars
}
}

Expand Down
4 changes: 2 additions & 2 deletions multiple-lambdas-integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "frontend_lambda_function" {
integration_type = var.integration_type
# Please do not change or replace the 'frontend' suffix since there a logic in the bot based in it
resource_name_pattern = local.api_triggered_function_name
env_vars = var.env_vars
env_vars = local.env_vars
logs_retention_in_days = var.lambda_logs_retention_in_days
should_write_logs = var.lambda_enable_logs
lambda_handler = local.frontend_lambda_handler
Expand All @@ -29,7 +29,7 @@ module "backend_lambda_function" {
integration_type = var.integration_type
# Please do not change or replace the 'backend' suffix since there a logic in the bot based in it
resource_name_pattern = "${local.resource_name_pattern}-backend"
env_vars = var.env_vars
env_vars = local.env_vars
logs_retention_in_days = var.lambda_logs_retention_in_days
should_write_logs = var.lambda_enable_logs
lambda_handler = local.backend_lambda_handler
Expand Down
2 changes: 1 addition & 1 deletion single-lambda-integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "lambda_function" {
environment = var.environment
integration_type = var.integration_type
resource_name_pattern = local.api_triggered_function_name
env_vars = var.env_vars
env_vars = local.env_vars
logs_retention_in_days = var.lambda_logs_retention_in_days
should_write_logs = var.lambda_enable_logs
timeout = var.lambda_function_timeout
Expand Down

0 comments on commit ceec324

Please sign in to comment.