Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errot running fmt through terramorf #6

Open
julianolf opened this issue Jan 5, 2024 · 0 comments
Open

Errot running fmt through terramorf #6

julianolf opened this issue Jan 5, 2024 · 0 comments

Comments

@julianolf
Copy link
Contributor

The argument -var-file is being appended to commands that does not support it when using the var_files feature inside terramorf.hcl configuration file.

Suppose we have the following configuration.

terraform {
  required_version = "1.6.6"

  backend {
    bucket = "terraform-${environment}"
  }

  var_files = [
    "environments/${environment}.tfvars"
  ]
}

environment "dev" {}

When trying to run the fmt command we endup with the following error.

% terramorf dev fmt
Terraform 1.6.6 required

+ /Users/juliano/.local/share/terramorf/bin/terraform-1.6.6 fmt -var-file=environments/dev.tfvars
Usage: terraform [global options] fmt [options] [target...]

  Rewrites all Terraform configuration files to a canonical format. All
  configuration files (.tf), variables files (.tfvars), and testing files
  (.tftest.hcl) are updated. JSON files (.tf.json, .tfvars.json, or
  .tftest.json) are not modified.

  By default, fmt scans the current directory for configuration files. If you
  provide a directory for the target argument, then fmt will scan that
  directory instead. If you provide a file, then fmt will process just that
  file. If you provide a single dash ("-"), then fmt will read from standard
  input (STDIN).

  The content must be in the Terraform language native syntax; JSON is not
  supported.

Options:

  -list=false    Don't list files whose formatting differs
                 (always disabled if using STDIN)

  -write=false   Don't write to source files
                 (always disabled if using STDIN or -check)

  -diff          Display diffs of formatting changes

  -check         Check if the input is formatted. Exit status will be 0 if all
                 input is properly formatted and non-zero otherwise.

  -no-color      If specified, output won't contain any color.

  -recursive     Also process files in subdirectories. By default, only the
                 given directory (or current directory) is processed.
Error parsing command-line flags: flag provided but not defined: -var-file
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 a pull request may close this issue.

1 participant