feat: support default workspace in tf plan/apply/refresh#49
Conversation
When no workspace argument is passed (e.g. `task tf:apply`), skip `workspace select` and `-var-file` so default-workspace modules relying on *.auto.tfvars work. Passing an environment arg (`task tf:apply -- automation`) preserves the existing behavior. A leading `-` is treated as a tofu/terraform flag, not a workspace, so `task tf:apply -- -auto-approve` works against the default workspace. Motivation: previously, default-workspace modules could be applied directly with `tofu apply` since the backend role had a default. Now that the backend role is split into READONLY/READWRITE and must be injected at init time, `task tf:*` is the supported entry point, so it needs to handle default-workspace modules too.
📝 WalkthroughWalkthroughThis PR modifies Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 I have created a release *beep* *boop* --- ## [0.6.0](v0.5.0...v0.6.0) (2026-05-17) ### Features * allow backend role arn to init (AIR-1495) ([#48](#48)) ([80fb117](80fb117)) * support default workspace in tf plan/apply/refresh ([#49](#49)) ([1b38f29](1b38f29)) ### Bug Fixes * pin GitHub Actions to commit SHAs (INT-326) ([#45](#45)) ([953d140](953d140)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
task tf:{plan,apply,refresh}with no args runs against the default workspace without-var-file;-- <env>preserves the named-workspace flow.task tf:*is the supported entry point and needs to handle default-workspace modules.tofu applyand it applies against the default workspace.task t:tf:apply(default) vstask t:tf:apply -- prod)PROOF OF VALIDATION