Skip to content

Auto-init the backend for force-unlock#20

Merged
gsavage merged 1 commit into
mainfrom
force-unlock-support
May 27, 2026
Merged

Auto-init the backend for force-unlock#20
gsavage merged 1 commit into
mainfrom
force-unlock-support

Conversation

@gsavage

@gsavage gsavage commented May 27, 2026

Copy link
Copy Markdown
Contributor

Running tf force-unlock <id> failed with "Backend initialization required, please run terraform init" because force-unlock was not in either of tf's known-subcommand sets, so it fell through to a bare terraform invocation with no backend config.

Add force-unlock to SUBCOMMANDS_NEEDING_BACKEND so it auto-runs terraform init first. Split the var-file injection in TfRunner.call() so it only happens for SUBCOMMANDS_ACCEPTING_VAR_FILE — force-unlock needs the backend wired up but does not accept -var-file.

Running `tf force-unlock <id>` failed with "Backend initialization
required, please run terraform init" because force-unlock was not in
either of tf's known-subcommand sets, so it fell through to a bare
`terraform` invocation with no backend config.

Add force-unlock to SUBCOMMANDS_NEEDING_BACKEND so it auto-runs
`terraform init` first. Split the var-file injection in TfRunner.call()
so it only happens for SUBCOMMANDS_ACCEPTING_VAR_FILE — force-unlock
needs the backend wired up but does not accept `-var-file`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gsavage gsavage merged commit 1b5ac1f into main May 27, 2026
1 check passed
@gsavage gsavage deleted the force-unlock-support branch May 27, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants