From 1b9906ce6bd5b16ffaa159e517261fcdfe303465 Mon Sep 17 00:00:00 2001 From: Brian McMahon Date: Thu, 28 May 2026 09:07:15 -0700 Subject: [PATCH] fix(freshness-deploy): use file:// for historical-cron put-targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deploy.sh --bootstrap was tripping on the put-targets shorthand when the Input contains JSON. From PR #339 the historical cron's target carries Input={"mode":"historical"}; the shorthand form Id=N,Arn=...,Input={...} confuses argparse on the embedded quotes + comma. Caught live 2026-05-28 when --bootstrap re-run partial-fired: ParamValidation: Error parsing parameter '--targets': Expected: '=', received: '"' for input Switch to a temp-file JSON spec via file://. The shorthand for the original 15-min cron stays unchanged because that target has no Input payload. The historical EB cron is wired live in AWS — target attached manually via direct CLI during this session with the same JSON. First daily firing at 04:00 UTC. This commit ensures the next operator who runs --bootstrap from main doesn't trip the same trap. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../lambdas/freshness-monitor/deploy.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/infrastructure/lambdas/freshness-monitor/deploy.sh b/infrastructure/lambdas/freshness-monitor/deploy.sh index 0fd433a..6ad9a2e 100755 --- a/infrastructure/lambdas/freshness-monitor/deploy.sh +++ b/infrastructure/lambdas/freshness-monitor/deploy.sh @@ -215,10 +215,26 @@ if $BOOTSTRAP; then --region "${REGION}" \ --query 'RuleArn' --output text + # JSON Input (`{"mode":"historical"}`) doesn't fit the put-targets + # shorthand form (Id=,Arn=,Input= chokes on the embedded quotes + + # comma). Write a temp JSON file + pass via file:// to dodge the + # shell-quoting trap. Caught live 2026-05-28 when --bootstrap re-run + # tripped argparse on the shorthand. + HIST_TARGET_JSON=$(mktemp) + cat > "${HIST_TARGET_JSON}" <