Skip to content

Commit

Permalink
refactor: default to opentofu
Browse files Browse the repository at this point in the history
Terraform has switched to an unfree license and is no longer provided by
the devShell. Thoenix now executes `tofu` by default. The command can be
specified with the `--command`, `-c` flag. Compatibility has been
otherwise maintained with this release.
  • Loading branch information
justinrubek committed Dec 5, 2023
1 parent 22ab04e commit ed2c503
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions crates/cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ pub(crate) struct Terraform {
#[arg()]
/// the arguments to pass to terraform
pub args: Vec<String>,
/// the command to run when invoking terraform
#[arg(long, short, default_value = "tofu")]
pub command: String,
}
2 changes: 1 addition & 1 deletion crates/cli/src/terraform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl crate::commands::Terraform {

// Call the terraform executable with the provided args
info!(?configuration_directory, ?self.args, "invoking terraform");
let terraform = tokio::process::Command::new("terraform")
let terraform = tokio::process::Command::new(&self.command)
.arg(format!("-chdir={}", configuration_directory.display()))
.args(self.args)
.spawn()?;
Expand Down
2 changes: 1 addition & 1 deletion flake-parts/shells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# formatting
self'.packages.treefmt
# misc
pkgs.terraform
pkgs.opentofu
];
in {
devShells = {
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed2c503

Please sign in to comment.