fix: update.sh --use-previous-parameters → per-param UsePreviousValue=true (U1, v20.5.3)#47
Merged
Merged
Conversation
…=true (U1, v20.5.3) **Severity: high.** Every customer upgrade attempt failed on first run. The bug: PR #26's Update-mode generator emitted update.sh with `--use-previous-parameters` on both `aws cloudformation update-stack` and `update-stack-set`. That flag does not exist in AWS CLI v2 (only `--use-previous-template`, a different thing). Customers ran the generated update.sh and hit "Unknown options: --use-previous-parameters" immediately. The fix: the generated script now calls describe-stack-set / describe-stacks first to enumerate current parameter keys, then builds a `--parameters ParameterKey=<K>,UsePreviousValue=true ...` list dynamically. Each existing parameter value is carried forward. Newly-added template parameters (for example ReconciliationInterval from v20.5.0) are intentionally OMITTED from the --parameters list so CFN picks up the new template's Default — that is the documented CFN behavior for omitted parameters during update-stack, and it is the correct behavior for a customer upgrading from pre-reconciliation to a template that adds it. If the describe call returns an empty result (unlikely, but possible if IAM is misconfigured), the script aborts with a clear error and cleans up the tmp template file rather than proceeding with an empty parameter list. Inline-comment stamps and the UI-facing confirm-risk blurb updated to reflect the new mechanism. The 7 non-English translations of the confirm-risk blurb still mention the old flag name — low-severity copy drift, flagged for a follow-up retranslation PR. Scope: only the update.sh generator. deploy.sh, the in-place scope- edit editor flow, and the YAML Lambda runtime are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 25, 2026
hyunsies
added a commit
that referenced
this pull request
Apr 25, 2026
* feat(configurator): delete.sh flow (v20.6.0) New fourth configurator mode: "Delete existing deployment". Generates delete.sh that cleanly removes MAP Auto-Tagger deployments. MINOR bump — safe in-place upgrade (YAML runtime byte-identical to v20.5.4 except four version stamps; adds new UI + new generated script only). Implements items 2, 4, 5, 6, 8 of Jin's Wave-0 scope (PR #27): - #2 Rename destroy → delete throughout (filename / UI / i18n keys / docs / internal JS) - #4 Default UX is "delete ALL map-auto-tagger-mig* in region"; opt-in checkbox reveals specific-MPE input - #5 Staging-bucket handling is automatic: delete when no other deployments remain, retain otherwise (no opt-in checkbox) - #6 Log-group opt-in kept (default off; audit history preserved) - #8 Type-DELETE confirmation works for both "delete all" and "scope to MPE" paths Flow: three-step (Configure → Review → Download), mirroring Deploy / Editor / Upgrade. Generates delete-all.sh by default; delete-<mpe>- <mpe>.sh when scoped. Script: - Enumerates map-auto-tagger-mig* Stacks and StackSets in region - For StackSets: deletes instances in parallel (100% tolerance), then the StackSet itself. 30-min wait ceiling. - For Stacks: delete-stack + wait - S3 staging bucket auto-decided — kept if any other deployment remains, deleted otherwise (race: simultaneous scoped deletes could both retain; accepted, same class as §1.108 TOCTOU) - Optional: delete matching CloudWatch Log Groups - NEVER deletes: map-migrated tags on AWS resources, StackSet admin / execution IAM roles (shared org scaffolding) - Legacy pre-namespacing stack detection — if no map-auto-tagger-mig* matches, probes for unnamespaced map-auto-tagger and emits manual- delete instructions instead of silent exit (same pattern as upgrade.sh v20.5.4) - Idempotent: missing resources = skipped (not failed); non-zero exit only on real failures MPE-ID regex in UI is permissive (alphanumeric, any length ≤20) to match the Lambda runtime's AllowedPattern ^mig[a-zA-Z0-9]+$. Will tighten to ^mig[a-z0-9]{10}$ once H6 product call lands repo-wide. Flagged as follow-up in CHANGELOG. English-only for new i18n keys (ui_mode_delete_*, ui_delete_*, err_delete_*); 7 non-English locales fall back to English via existing t() behavior. Translation follow-up flagged; same pattern as ui_update_confirm_risk (PR #47) and ui_upgrade_* (PR #48a). E2E coverage deferred to a follow-up PR per Sprint 7 P3 mandate (every generator output gets E2E before ship). The delete.sh harness lives alongside the existing deploy.sh harness in .github/scripts/ — separating the two PRs keeps both reviewable. Layer 1 local: sync-check ✅, lint_cfn_correctness ✅, lint_event_prefixes ✅, lint_shell_injection ✅, HTML well-formed ✅, YAML Lambda py_compile ✅, cfn-lint ✅. Both script variants (delete-all and scoped) render cleanly and pass `bash -n`. Co-authored-by: Jin Shan Ng <ngjinshan99@gmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(configurator): MPE enforcement + i18n coverage in delete flow (v20.6.0) Three fixes to the delete.sh flow before PR #49 merges: 1. MPE ID format enforcement now mirrors Editor/Update modes — DELETE_MPE_REGEX tightened from /^[a-zA-Z0-9]+$/ to the same 10-char /^(?=.*[A-Z])(?=.*[0-9])[A-Z0-9]{10}$/ the other flows use. Invalid rows get red .error highlighting like updateReview(). 2. MPE input auto-uppercases and strips non-[A-Z0-9] on keystroke, matching the editor/update inputs. maxlength also dropped from 20 to 10 to reflect the real format. 3. Language switching mid-flow now re-renders the delete review table (dstep2) and the delete-instructions preview (dstep3) — previously only the main editor step2 and deploy step3 were re-rendered on language switch. Also fills 31 missing delete-related i18n keys across ko/ja/zh/id/th/vi (previously all fell through to English) and defines rv_enabled which was referenced in deleteReview() but never in TRANSLATIONS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: chhyu-runner <noreply@anthropic.com> Co-authored-by: Jin Shan Ng <ngjinshan99@gmail.com> Co-authored-by: Chris Hyu <chhyu@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Severity: high. Every customer upgrade attempt with the PR-#26 Update-mode generator failed on first run. Closes U1 from the 2026-04-24 correctness sweep.
The generated
update.shinvokedaws cloudformation update-stackandupdate-stack-setwith--use-previous-parameters. That flag does not exist on either command in AWS CLI v2 (only--use-previous-template, which is a different thing). Customers gotUnknown options: --use-previous-parametersimmediately.Fix
The generated script now:
describe-stack-set/describe-stackswith--query "...Parameters[].ParameterKey"to enumerate current parameter keys.--parameters ParameterKey=<K>,UsePreviousValue=true ...list dynamically.Newly-added template parameters (e.g.
ReconciliationIntervalfrom v20.5.0) are intentionally omitted from the--parameterslist so CFN picks up the new template'sDefault— documented CFN behavior for omitted parameters during update-stack, correct for customers upgrading from pre-reconciliation to a template that adds it.If the describe call returns empty (IAM misconfig edge case), the script aborts with a clear message rather than proceeding with an empty
--parameterslist.Scope
configurator.html: new PARAM_KEYS enumeration helper + two emit-site fixes ineditorGenerateUpgrade. VERSION_HISTORY v20.5.3 entry. Inline-comment stamps and UI-facing confirm-risk blurb updated. VERSION bump.map2-auto-tagger-optimized.yaml: version bump only (v20.5.2→v20.5.3at 4 sites).CHANGELOG.md+VERSIONING.md: v20.5.3 entries.No runtime Lambda change. YAML byte-identical to v20.5.2 except version stamps.
Not in scope: the 7 non-English translations of
ui_update_confirm_riskstill reference the old--use-previous-parametersflag name. Copy-drift only, low severity — flagged in the commit body for a follow-up retranslation PR.Test plan
Local (done):
sync-check.pypasseslint_cfn_correctness.pypasseslint_event_prefixes.pypasseslint_shell_injection.pypasses (no U4 regression)cfn-lintsilent (clean)$(aws ...),$VARNAME,\\all render as expected bashCI (Layer 1 required):
Next-time end-of-sprint Layer 2: includes a
generate update.sh → run against test stackstep today. Should catch regressions of this class if added.🤖 Generated with Claude Code