feat: allow targeted applies and keep the Grafana token rotated - #118
Open
nboyers wants to merge 1 commit into
Open
feat: allow targeted applies and keep the Grafana token rotated#118nboyers wants to merge 1 commit into
nboyers wants to merge 1 commit into
Conversation
The Grafana service-account token in aws/us-east-2/monitoring has a 30-day TTL and only rotates when that unit is applied. Before per-unit filtering landed, every push to main applied the whole estate, which kept it fresh. Now nothing applies that unit unless its own files change, so the token lapses and `terraform plan` on aws/us-east-2/grafana fails with a 401. - workflow_dispatch gains a `filter` input so a single unit can be applied from CI. There was previously no way to do this: dispatch set changed_dirs=[] and applied all 33 units. - A weekly schedule re-applies only the rotation unit, restoring what full-estate applies used to do implicitly. - Push behaviour is unchanged. The dispatch input is read via env rather than template interpolation, and validated against a path charset, because FILTER_ARGS is later eval'd. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Unblocks the
Expired API keyplan failure on #117, and stops it recurring.The bug
The Grafana service-account token lives in
aws/us-east-2/monitoring:time_rotatingonly rotates when that unit is applied. Before per-unit filtering landed (2026-07-30), every push to main applied the whole estate, so it stayed fresh. Now nothing applies it unless its own files change — last touched 2026-07-29. The token lapsed, andterraform planonaws/us-east-2/grafana401s reading its existing datasources and dashboards. Plan can't fix it: it reads the dependency output from state and never applies anything.Changes
workflow_dispatchgains afilterinput so one unit can be applied from CI. There was no way to do this before — dispatch setchanged_dirs=[]and applied all 33 units.0 6 * * 1) re-applies onlyaws/us-east-2/monitoring, restoring what full-estate applies used to do implicitly.Notes for review
env:rather than template interpolation and validated against a path charset, becauseFILTER_ARGSis latereval'd.main, not fix: scope terraform CI to what actually changed #117, so it can land independently. fix: scope terraform CI to what actually changed #117 will need a rebase.Verified
Logic simulated locally: schedule →
["aws/us-east-2/monitoring"]; dispatch with one or several units → correct--filter=args;; rm -rf /,$(id), and backtick inputs all rejected.🤖 Generated with Claude Code