Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions terraform/modules/api/lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,8 @@ module "sprints_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_reader.arn
Expand Down Expand Up @@ -1645,6 +1647,8 @@ module "tasks_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_tasks.arn
Expand Down Expand Up @@ -1764,6 +1768,8 @@ module "questions_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_questions.arn
Expand Down Expand Up @@ -1801,6 +1807,8 @@ module "sprint_graph_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_reader.arn
Expand Down Expand Up @@ -2319,6 +2327,8 @@ module "timeline_events_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_reader.arn
Expand Down Expand Up @@ -2575,6 +2585,8 @@ module "migrate_tracker_fields_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.neptune_reader.arn
Expand Down Expand Up @@ -2613,6 +2625,8 @@ module "building_blocks_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.blocks.arn
Expand Down Expand Up @@ -2659,6 +2673,8 @@ module "seed_blocks_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.seed_blocks.arn
Expand Down
10 changes: 10 additions & 0 deletions terraform/modules/realtime/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ locals {
realtime_partition = data.aws_partition.realtime.partition
realtime_dns_suffix = data.aws_partition.realtime.dns_suffix
all_lambdas_in_vpc = var.lambda_vpc_scope == "all"
# ws-connection bundles lambda/shared/** via esbuild, but the lambda module
# only hashes its own source_path. Fold the shared tree into hash_extra so a
# shared-file change rebuilds the package (same as modules/api/lambda).
shared_dir = "${path.module}/../../../lambda/shared"
shared_sources_hash = sha256(join("", [
for f in sort(fileset(local.shared_dir, "**/*.{js,mjs,cjs,json}")) :
filesha256("${local.shared_dir}/${f}")
]))
}

# IAM Role for Lambda functions
Expand Down Expand Up @@ -96,6 +104,8 @@ module "connection_lambda" {
]
}
]
# Force a rebuild when bundled lambda/shared/** changes (see local above).
hash_extra = local.shared_sources_hash

create_role = false
lambda_role = aws_iam_role.lambda.arn
Expand Down
Loading