Skip to content

Commit

Permalink
release/2024-11-19-a Shorten lambda name
Browse files Browse the repository at this point in the history
  • Loading branch information
megan-bower4 committed Nov 19, 2024
1 parent 6e1be8e commit 50ff245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion infrastructure/terraform/per_workspace/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ module "lambdas" {
source = "./modules/api_worker/api_lambda"
python_version = var.python_version
name = each.key
lambda_name = "${local.project}--${replace(terraform.workspace, "_", "-")}--${replace(replace(replace(each.key, "_", "-"), "DeviceReferenceData", "DeviceRefData"), "MessageHandlingSystem", "MHS")}"
lambda_name = "${local.project}--${replace(terraform.workspace, "_", "-")}--${replace(replace(replace(replace(each.key, "_", "-"), "DeviceReferenceData", "DeviceRefData"), "MessageHandlingSystem", "MHS"), "MessageSet", "MsgSet")}"

//Compact will remove all nulls from the list and create a new one - this is because TF throws an error if there is a null item in the list.
layers = concat(
compact([for instance in module.layers : contains(var.api_lambda_layers, instance.name) ? instance.layer_arn : null]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
}
methods = [
for lambda_alias in setsubtract(var.lambdas, ["authoriser"]) :
{ "method_${lambda_alias}" = "${local.apigateway_lambda_arn_prefix}:${var.assume_account}:function:${var.project}--${replace(terraform.workspace, "_", "-")}--${replace(replace(replace(lambda_alias, "_", "-"), "DeviceReferenceData", "DeviceRefData"), "MessageHandlingSystem", "MHS")}/invocations" }
{ "method_${lambda_alias}" = "${local.apigateway_lambda_arn_prefix}:${var.assume_account}:function:${var.project}--${replace(terraform.workspace, "_", "-")}--${replace(replace(replace(replace(lambda_alias, "_", "-"), "DeviceReferenceData", "DeviceRefData"), "MessageHandlingSystem", "MHS"), "MessageSet", "MsgSet")}/invocations" }
]
swagger_file = templatefile("${path.root}/../../swagger/dist/aws/swagger.yaml", merge({
lambda_invoke_arn = var.authoriser_metadata.lambda_invoke_arn,
Expand Down

0 comments on commit 50ff245

Please sign in to comment.