mattray / inspec-iggy

InSpec CLI plugin for generating compliance controls from Terraform and CloudFormation
Apache License 2.0
106 stars 18 forks source link

Inspec can't find terraform executable #9

Closed haidangwa closed 5 years ago

haidangwa commented 6 years ago

A dup of #4, but that issue was closed by the original submitter. However, I'm seeing this problem today.

inspec-iggy 0.2.0 chefdk 3.0.36 and 3.1.0 Terraform v0.11.7

Terraform is installed on my mac at /usr/local/bin/terraform. I also tried symlinking /opt/chefdk/bin/terraform to it, but the result is the same.

build$ inspec terraform version
Could not find command "terraform".
build$ gem list inspec

*** LOCAL GEMS ***

debug_inspector (0.0.3)
inspec (2.2.50, 2.1.72)
inspec-iggy (0.2.0)
kitchen-inspec (0.23.1)
build$ chef --version
Chef Development Kit Version: 3.1.0
chef-client version: 14.2.0
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.4
kitchen version: 1.22.0
inspec version: 2.1.72
evgmoskalenko commented 6 years ago

The same problem

chris-rock commented 6 years ago

I assume the problem is related to your installation method. your are using the inspec command from chefdk but installed inspec-iggy in your normal ruby environment. In order to use inspec-iggy with chefdk you would need to run chef gem install inspec-iggy

binamov commented 5 years ago

same problem, i used my system ruby to install inspec and inspec-iggy... terraform executable is in /usr/local/bin and in $PATH. Feels like inspec-iggy may have some assumptions around where the terraform executable lives?

mattray commented 5 years ago

The error message is a bit obtuse, it's not actually looking for the "terraform" command, it can't find the "inspec terraform" subcommand.

The README for the upcoming 0.3.0 (https://github.com/inspec/inspec-iggy/pull/14) documents several installation techniques (ChefDK, InSpec Omnibus, Rubygems and development). Right now it works with Linux & MacOS, I'll get Windows sorted eventually.

mattray commented 5 years ago

Iggy is now a a proper InSpec plugin. Try installing with "inspec plugin install inspec-iggy" and you should get the "inspec terraform" subcommands.