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

Validate against 0.12 fails #21

Open
stimms opened this issue May 23, 2019 · 5 comments
Open

Validate against 0.12 fails #21

stimms opened this issue May 23, 2019 · 5 comments

Comments

@stimms
Copy link

stimms commented May 23, 2019

The default arguments for validate have changed in 0.12 and it no longer allows -input=false -no-color. This results in the error message

Usage: terraform validate [options] [dir]

  Validate the configuration files in a directory, referring only to the
  configuration and not accessing any remote services such as remote state,
  provider APIs, etc.

  Validate runs checks that verify whether a configuration is
  internally-consistent, regardless of any provided variables or existing
  state. It is thus primarily useful for general verification of reusable
  modules, including correctness of attribute names and value types.

  It is safe to run this command automatically, for example as a post-save
  check in a text editor or as a test step for a re-usable module in a CI
  system.

  Validation requires an initialized working directory with any referenced
  plugins and modules installed. To initialize a working directory for
  validation without accessing any configured remote backend, use:
      terraform init -backend=false

  If dir is not specified, then the current directory will be used.

  To verify configuration in the context of a particular run (a particular
  target workspace, operation variables, etc), use the terraform plan
  subcommand instead, which includes an implied validation check.

Options:

  -json        Produce output in a machine-readable JSON format, suitable for
               use in e.g. text editor integrations.
@paulirwin
Copy link
Contributor

This also affects the terraform workspace commands too. terraform workspace select foo fails with v0.12 because -input=false is no longer allowed. My suggestion would be to have a checkbox to specify whether or not to pass these flags.

@paulirwin
Copy link
Contributor

Looks like the validate case was resolved with PR #23 but it needs to do the same logic for workspace as well. Can we get an updated extension that makes it something like if ($arguments.Trim() -like "validate*" -or $arguments.Trim() -like "workspace*") {?

@pgroene
Copy link
Contributor

pgroene commented Jul 8, 2019

@paulirwin would you be able to make a PR for that? I will accept it asap, but I do not have enough time to write the fix and test it. Off course I'll do some code reviewing of the change.

@pgroene
Copy link
Contributor

pgroene commented Jul 8, 2019

@paulirwin I see you already did create a pr for this. Sorry I missed it, I was on vacation :). I'll have a look now.

@mud5150
Copy link
Contributor

mud5150 commented Aug 8, 2019

Sorry I haven't had any time to make an effort on any of these issues. I was hoping I would be able to get all of our tooling for terraform up to speed with the 0.12 changes.

One thing I noticed was that they added an environment variable for disabling interactive prompting. I haven't tested it yet, but I would bet the commands that don't support it would just ignore the value. Then we wouldn't need the extra case handling for certain commands.

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.

4 participants