Skip to content

Commit 0a4849f

Browse files
chore: add comment in calculated variable to help post-merged maintenance
1 parent 3212ad4 commit 0a4849f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/webhook/webhook.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ locals {
55
# sorted list
66
runner_matcher_config_sorted = [for k in sort(keys(local.runner_matcher_config)) : local.runner_matcher_config[k]]
77

8+
# Calculate worst-case scenario values to determine optimal parameter chunking
9+
# These intermediate values help estimate the maximum possible size of the matcher config JSON
10+
# when serialized, allowing us to pre-calculate how to split it across multiple SSM parameters
11+
# if it exceeds the size limits (4KB for Standard tier, 8KB for Advanced tier).
12+
813
# Define worst-case dummy ARN/ID lengths
914
worst_case_arn = join("", [for i in range(0, 127) : "X"]) # ARN length assuming 80-char queue name, longest partition & region
1015
worst_case_id = join("", [for i in range(0, 135) : "Y"]) # SQS URL length for same worst-case scenario
1116

12-
# Compute worst-case JSON length
17+
# Compute worst-case JSON length using maximum possible ARN/ID values
18+
# This ensures we allocate enough parameter chunks even in the most extreme case
1319
worst_case_json_length = length(jsonencode([for r in local.runner_matcher_config_sorted : merge(r, { arn = local.worst_case_arn, id = local.worst_case_id })]))
1420

1521
# Set max chunk size based on SSM tier

0 commit comments

Comments
 (0)