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

Does kitchen-inspec support AWS targets? #179

Open
cameronattard opened this issue Mar 23, 2018 · 8 comments
Open

Does kitchen-inspec support AWS targets? #179

cameronattard opened this issue Mar 23, 2018 · 8 comments
Assignees
Labels
Type: Enhancement Adds new functionality.

Comments

@cameronattard
Copy link

Hi,

I've got some inspec suites that exclusively test AWS resources. Using inspec alone, I can successfully execute them using inspec exec tests -t aws://.

I'm now trying to use test-kitchen to provision a CloudFormation stack (using kitchen-cloudformation, and then run these tests against the provisioned resources.

Is there any way to configure kitchen-inspec to run against the aws:// target? It seems to expect an SSH target, and I'm getting the following error: Failed to complete #verify action: [Client error, can't connect to 'ssh' backend: You must provide a value for "host".]

Thanks.

@philipsahli
Copy link

philipsahli commented Mar 28, 2018

Same need in our project. Is there any chance that kitchen-inspec will support that in the near future?

@murraypete
Copy link

Same here, though for Azure...would be very useful to have.

@chris-rock
Copy link
Collaborator

This is very good feedback! Thank you for reporting. It would be helpful to get a sample kitchen setup from you for azure and aws, so that we can use this for testing.

@bcarpio
Copy link

bcarpio commented May 16, 2018

I would love to get this setup as well. Right now in Jenkins we have to call inspec directly since "kitchen verify" cannot support aws targets.

@brandonjbjelland
Copy link

brandonjbjelland commented Jul 3, 2018

I'm trying to do this same thing with kitchen-terraform on GCP and I'm unable to do so. It would make sense (from my somewhat limited use of inspec) if we were able to specify the default target within inspec.yml rather than confining this option only to the command line.

@chris-rock - my .kitchen.yml looks like the following:

---
driver:
  name: terraform
  root_module_directory: examples/zk-test-fixture

provisioner:
  name: terraform

platforms:
- name: gcp

verifier:
  name: terraform
  # inspec_options: "-t gcp://" # no way to force this currently

suites:
  -
    name: default
    verifier:
      groups:
        -
          name: default
          controls:
            - zookeeper

@cameronattard - not sure if this is helpful for you but when using terraform, awspec works in the way you're after. Example: https://github.com/terraform-aws-modules/terraform-aws-alb/blob/master/test/integration/default/test_alb.rb

@zenspider
Copy link

This requires @kekaichinose to weigh in.

@onetwopunch
Copy link

Is there any update on this? It would be great to use the gcp type in kitchen-terraform as well.

@damacus
Copy link
Contributor

damacus commented Apr 28, 2020

For anyone looking for an answer to this my current solution is bewlow. Using kitchen-terraform & kitchen-inspec

It feels like setting platforms to AWS should invoke the correct verifier, in this case aws

# kitchen.yml
---
driver:
  name: terraform
provisioner:
  name: terraform
verifier:
  name: terraform
  systems:
    - name: default
      backend: aws

platforms:
  - name: aws

suites:
    - name: default
# Gemfile
source 'https://rubygems.org/'

gem 'kitchen-terraform'
gem 'kitchen-inspec'
gem 'test-kitchen'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests