Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 19 09:48
    snowlepo commented #470
  • Feb 19 09:48
    snowlepo closed #470
  • Feb 19 03:16
    snowlepo commented #470
  • Feb 19 03:16
    snowlepo commented #470
  • Feb 19 03:05
    snowlepo opened #470
  • Feb 08 18:51
    aaron-lane labeled #469
  • Feb 08 18:51
    aaron-lane labeled #469
  • Feb 07 21:21
    tbugfinder opened #469
  • Jan 22 22:21

    aaron-lane on v6.1.0

    (compare)

  • Jan 22 22:19

    aaron-lane on master

    6.1.0 (#468) * Add support for… (compare)

  • Jan 22 22:19

    aaron-lane on aaron-lane-6.1.0

    (compare)

  • Jan 22 22:19
    aaron-lane closed #468
  • Jan 22 22:19
    aaron-lane closed #467
  • Jan 22 22:19
    aaron-lane edited #468
  • Jan 22 22:18
    aaron-lane ready_for_review #468
  • Jan 22 22:17
    aaron-lane closed #397
  • Jan 22 22:15
    aaron-lane closed #355
  • Jan 22 22:09
    aaron-lane synchronize #468
  • Jan 22 22:09

    aaron-lane on aaron-lane-6.1.0

    Remove obsolete Travis CI refer… Update tty-which to ~> 0.5.0 Update bundle binstub and 2 more (compare)

  • Jan 22 21:44

    aaron-lane on master

    Create codeql-analysis.yml (compare)

Aaron Lane
@aaron-lane
🤾
Edward Bartholomew
@edwardbartholomew
So long and thanks for all the memories Ruby 2.3!
Aaron Lane
@aaron-lane
v4.4.0 has been released. You can now specify the driver client, which means terraform no longer has to be on the PATH, and terragrunt is a viable option :beers:
Next up: automatic downloads of terraform :scream_cat:
Aaron Lane
@aaron-lane
Or not. But v4.5.0 and v4.6.0 are both out :trumpet:
@superyarick @aaronlippold #173 is about to be fixed with v4.7.0
Yarick Tsagoyko
@yarick
@aaron-lane👍
Aaron Lane
@aaron-lane
Which is old news, because we're up to v4.9.0 now!
And v5.0.0 is coming up
🤡
Aaron Lane
@aaron-lane
@tbugfinder yes, thank you. Early morning releases :zzz:
tdsacilowski
@tdsacilowski

Hi all! I have a question regarding backend-configurations, specifically interacting with Terraform's remote backend. I've posted my question as a follow-on to this thread: newcontext-oss/kitchen-terraform#341. A colleague of mine also mentioned you all have a gitter room so I figured I'd post here as well. Thanks!

Hi there, I have an additional question on this topic... and forgive me if I misunderstand how some of this configuration works, still wrapping my head around kitchen-terraform.

Makes sense that you'd define the backend type in your Terraform configuration file and just pass specific parameters for it through your kitchen.yml file. One area where I see an issue though is with the remote backend type.

This type takes a number of configuration parameters, one of them being workspaces, which is configured as a block. The documentation for Class: Kitchen::Driver::Terraform indicates that backend_configurations is of the type "Mapping of scalars to scalars", which seems to indicate that I can't have a nested block here.

This would be especially useful for setting a prefix to be added to the workspaces that kitchen-terraform creates via the CLI, since the remote backend also supports a CLI-driven workflow for interfacing with Terraform Cloud and Terraform Enterprise.

Curious if this is supported and if maybe I'm just missing something?

For reference, I tried the following in my kitchen.yml file:

---
driver:
  name: terraform

  backend_configurations:
    organization: teddyruxpin
    hostname:     app.terraform.io
    workspaces:
      prefix: kt-validate
...

And received the following error response:

Dev/ptfe-testing/terraform-gcp via 🛠 default took 3s
❯ bundle exec kitchen verify
-----> Starting Kitchen (v1.25.0)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Kitchen::Driver::Terraform configuration: backend_configurations {:value=>["must be a hash which includes only symbol keys and string values"]}
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
Aaron Lane
@aaron-lane
@tdsacilowski sorry for the delay! I replied a couple of days ago https://github.com/newcontext-oss/kitchen-terraform/issues/341#issuecomment-504443780
tdsacilowski
@tdsacilowski
Hi @aaron-lane thanks for the heads-up! I did see your reply and there are a few things I'm working on on my end and will update the ticket shortly.
Josef
@tbugfinder
Hi, while running kitchen verify I noticed that some output of inspec might get reduced (using ...), e.g. while testing many tags of an ec2 instance. Is there any setting to get always full output or is this more an inspec question?
Aaron Lane
@aaron-lane
@tbugfinder it's a both question. 😊 It may be a matter of changing the reporter which you can configure in the Kitchen configuration file
Brian G. Shacklett
@bgshacklett
My apologies if this has been discussed already, but does anyone know what effect, if any, Chef's new license policy has on using Kitchen-Terraform?
I.e., is it required to license Chef due to Inspec being used?
Aaron Lane
@aaron-lane
@bgshacklett I don't believe it has been discussed. As far as I am aware, the license only applies to the inspec-bin gem, whereas we use the plain inspec gem
Brian G. Shacklett
@bgshacklett
One thing that's interesting about that gem is that it has a runtime dependancy on https://rubygems.org/gems/license-acceptance. While I've never seen a request to accept a license when installing, that is a bit concerning.
Purple90
@Purple90
I just wanted to see if I am doing something wrong. I am running through the tutorial here - https://newcontext-oss.github.io/kitchen-terraform/getting_started.html and the tests are failing at the last step.
  ×  file_check: File .kitchen/kitchen-terraform/kt-suite-terraform/foobar
     ×  File .kitchen/kitchen-terraform/kt-suite-terraform/foobar should exist
     expected File .kitchen/kitchen-terraform/kt-suite-terraform/foobar to exist
I do see foobar, but it is here
test/fixtures/tf_module/foobar
Jeff
@jeffcampbell
Anyone using kitchen-terraform with GCP? I am wondering if it always creates a new project when switching to a new workspace. Due to the nature of our terraform implementation we are strict with our resourcemanager.projectCreator roles. data.terraform_remote_state.organization: Refreshing state... google_project.project: Creating...
Aaron Lane
@aaron-lane
@Purple90 oh no, the tutorial may be out of date 😥thanks for pointing that out
@jeffcampbell 👋we spoke out of band, but for the benefit of the rest of the group, the use of workspaces means that all resources in the graph of the root_module_directory will be created specifically for the Kitchen Terraform instance
Edward Bartholomew
@edwardbartholomew
I have proposed writing an article for Azure docs regarding terraform testing with kitchen-terraform thumbs up appreciated: MicrosoftDocs/azure-docs#38222
Aaron Lane
@aaron-lane
Already done!
alepeltier
@alepeltier

Hello All,

Is there a way to mock remote states in kitchen or does the remote state file need to exist before hand ?

For example, I've got a brand new environment which I'm trying to test my code against. I haven't run an apply in this environment yet and I get the following Terraform error when running "kitchen test"

Error: Unable to find remote state

     on data.tf line 4, in data "terraform_remote_state" "eks":
      4: data "terraform_remote_state" "eks" {

   No stored state was found for the given workspace in the given backend.


   Error: Unable to find remote state

     on data.tf line 25, in data "terraform_remote_state" "vpc":
     25: data "terraform_remote_state" "vpc" {
alepeltier
@alepeltier
Ah actually never mind I see that kitchen converge will create a test environment in AWS for me so I'll need the VPC and EKS states to be there beforehand.
On another point, any idea when terraform 12 will be supported?
Aaron Lane
@aaron-lane
@alepeltier Terraform 0.12 has been supported since Kitchen-Terraform 4.9.0 back on 2019-05-27 :D
Aaron Lane
@aaron-lane
Regarding remote state, Kitchen-Terraform was designed with the intent of testing individual modules, rather than environment configurations which leverage remote state. It's certainly possible to use remote state, but there are some changes needed to make this efficient. newcontext-oss/kitchen-terraform#348 comes to mind
alepeltier
@alepeltier

@aaron-lane Thank you for the reply sorry it's taken me so long to get back to you.

I'm glad tf 12 is supported I'll get that installed right away. I'll have a look at how we can use kitchen Terraform within our environment even if we have to do specific module testing for the time being it is better than nothing.

I'll also keep an eye on that git issue hopefully it is something that can be accommodated in future releases.
Aaron Lane
@aaron-lane
@alepeltier if you have any information you can share about your use case of testing configurations more complex than individual modules, please do so on a GitHub issue. I think it would be valuable for Kitchen-Terraform to be able to easily support more than one testing pattern
alepeltier
@alepeltier
@aaron-lane no worries I've had to put it on the back burner for a bit but once I pick it up I'll feed in our use case.
Edward Bartholomew
@edwardbartholomew
Was trying to update a tutorial or two but having a beast of a time trying to get middleman working even tried Docker images to no avail. Does middleman run as part of the build process or should the generated files be in the PR?
Aaron Lane
@aaron-lane
The generated files should be part of the pull request, but I'd really like to migrate to the format natively supported by GitHub Sites
Annie Hedgpeth
@anniehedgie_twitter
Hi, I see that I can use winrm as a backend, but I can't seem to get it to work with password authentication. Just wanted to confirm that password auth is enabled for winrm and not just ssl.
Annie Hedgpeth
@anniehedgie_twitter
I just found this comment about connections through InSpec - https://github.com/newcontext-oss/kitchen-terraform/issues/317#issuecomment-454264007. I'll troubleshoot that I can connect through InSpec.
Annie Hedgpeth
@anniehedgie_twitter
I can connect with an inspec exec so I guess I'll keep plugging trying different things in the kitchen.yml.
Annie Hedgpeth
@anniehedgie_twitter
Edward Bartholomew
@edwardbartholomew
Is anyone using Terraform variables in their Inspec tests as introduced in 4.8.0? Seems to only work through "variables" in kitchen.yml and not "variable_files" ... Not sure if that's expected from the wording of the CHANGELOG though (https://github.com/newcontext-oss/kitchen-terraform/blob/master/CHANGELOG.md#480---2019-04-14)
Aaron Lane
@aaron-lane
That is expected! I've been wary of doing any state inspection to derive values so it only works for the variables defined in the Kitchen configuration file