Repository navigation
fix(ttl-reaper): pass sam deploy parameters via a params file - #455
Merged
Merged
Conversation
Found while performing the deploy #453 made possible: `make deploy` did not work at all with the parameters #453 added. sam matches the ENTIRE --parameter-overrides string against one regex, and an empty value breaks that match. NOTIFY_URL, DNS_ZONE_ID and DNS_DOMAIN are all empty by default, so the invocation either failed at argument parsing — Error: Invalid value for '--parameter-overrides': NotifyUrl= is not a valid format. — or, with the long ParameterKey=…,ParameterValue=… form, fell through to a different pattern and mis-keyed everything: Parameter overrides : {"Environment": "production", "DryRun": "true", "ParameterKey": "NotifyUrl,ParameterValue=", ...} That second form is the dangerous one. The deploy SUCCEEDS, but NotifyUrl was never overridden and a bogus "ParameterKey" parameter was submitted instead — a deploy that applies something other than what was asked for, with no error to notice. Repeating the flag per pair doesn't work either: the last occurrence wins and the rest are silently dropped. Generate a file:// params file instead, the only form that accepts empty values (verified: all eight parameters arrive intact, NotifyUrl as ""), and echo the mode-setting parameters — dry-run, scan-self, dns-sweep, zone, domain — so a deploy can never quietly leave a feature off. Not NotifyUrl: it's a Slack webhook secret and does not belong in a console or CI log. The generated file is gitignored and removed by `make clean`. Verified by deploying the reaper for real: parameters landed correctly, and the live init line now reads dns-sweep=true (sweep enabled, still dry-run) where before it had no dns-sweep field at all.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Jul 31, 2026
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.
Found while performing the deploy #453 made possible:
make deploydid not actually work with the parameters #453 added.The bug
sammatches the entire--parameter-overridesstring against a single regex (types.py:194-208), and an empty value breaks that match.NOTIFY_URL,DNS_ZONE_IDandDNS_DOMAINare all empty by default, so it failed two different ways:Loudly, with the short
Key=Valueform:Silently, with the long
ParameterKey=…,ParameterValue=…form — it falls through to the other pattern and mis-keys everything:The silent form is the one that matters: the deploy succeeds, but
NotifyUrlwas never overridden and a bogus parameter namedParameterKeywas submitted in its place. A deploy that applies something other than what was asked for, with nothing to notice. Repeating the flag per pair isn't a fix either — the last occurrence wins and the rest are dropped ({"DnsSweep": "true"}only).The fix
Generate a
file://params file — the only form that handles empty values. Verified all eight parameters arrive intact withNotifyUrlas"":The deploy also echoes the mode-setting parameters (
dry-run,scan-self,dns-sweep, zone, domain) so a deploy can't quietly leave a feature off — but notNotifyUrl, which is a Slack webhook secret and doesn't belong in a console or CI log. The generated file is gitignored and removed bymake clean.Verification
Deployed the reaper for real (approved, dry-run mode). Parameters landed correctly and the live init line now reads:
Before this it had no
dns-sweepfield at all. An on-demand invoke returns the post-#438 summary shape ("dns_scanned":0,"dns_reaped":0) with zero errors.DNSScanned=0is expected — the sweep only covers accounts inRoleArns(dev5k0zfnmq, which has no records); the known orphan is under4zlw3a1t, an account not in that list, as #453's README now warns.