Skip to content

Commit 3cfd81c

Browse files
committed
add try to env var which may be null
1 parent 31641e5 commit 3cfd81c

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

infrastructure/terraform/components/app/module_download_authorizer_lambda.tf

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module "download_authorizer_lambda" {
66
}
77

88
function_name = "download-authorizer"
9-
description = "Download authorizer for s3 origin"
9+
description = "Download authorizer for s3 download bucket"
1010

1111
aws_account_id = var.aws_account_id
1212
component = var.component
@@ -22,19 +22,16 @@ module "download_authorizer_lambda" {
2222
body = data.aws_iam_policy_document.authorizer.json
2323
}
2424

25-
function_s3_bucket = local.acct.s3_buckets["lambda_function_artefacts"]["id"]
26-
function_code_base_path = local.aws_lambda_functions_dir_path
27-
function_code_dir = "${lambdas_source_code_dir}/download-authorizer/dist"
28-
function_include_common = true
29-
function_module_name = "handler"
30-
runtime = "nodejs20.x"
31-
memory = 128
32-
timeout = 5
33-
log_level = var.log_level
34-
lambda_at_edge = true
35-
36-
force_lambda_code_deploy = var.force_lambda_code_deploy
25+
function_s3_bucket = local.acct.s3_buckets["lambda_function_artefacts"]["id"]
26+
function_code_base_path = local.lambdas_source_code_dir
27+
function_code_dir = "download-authorizer/dist"
28+
handler_function_name = "handler"
29+
runtime = "nodejs20.x"
30+
memory = 128
31+
timeout = 3
32+
lambda_at_edge = true
3733
enable_lambda_insights = false
34+
force_lambda_code_deploy = true
3835
}
3936

4037
data "aws_iam_policy_document" "authorizer" {

infrastructure/terraform/modules/backend-api/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ locals {
3838
}
3939

4040
backend_lambda_environment_variables = {
41-
DEFAULT_LETTER_SUPPLIER = local.default_letter_supplier.name
41+
DEFAULT_LETTER_SUPPLIER = try(local.default_letter_supplier.name, "unset")
4242
ENABLE_LETTERS_BACKEND = var.enable_letters
4343
ENVIRONMENT = var.environment
4444
NODE_OPTIONS = "--enable-source-maps"

0 commit comments

Comments
 (0)