Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:15
    aaron-lane closed #411
  • 15:15
    aaron-lane commented #411
  • 14:47
    jnahelou commented #411
  • Oct 26 15:50

    aaron-lane on master

    Fix test badges in README (compare)

  • Oct 11 08:03
    rubans commented #464
  • Oct 07 18:22
    tbugfinder closed #465
  • Oct 07 18:22
    tbugfinder commented #465
  • Oct 07 15:12
    aaron-lane labeled #465
  • Oct 07 15:12
    aaron-lane labeled #465
  • Oct 07 15:11
    aaron-lane commented #465
  • Oct 07 10:40
    tbugfinder opened #465
  • Sep 23 14:36
    aaron-lane commented #464
  • Sep 23 07:20
    rubans commented #464
  • Sep 22 08:07
    rubans commented #464
  • Sep 21 20:55
    aaron-lane commented #464
  • Sep 21 20:48
    aaron-lane commented #464
  • Sep 21 15:04
    rubans commented #464
  • Sep 21 14:45
    aaron-lane commented #464
  • Sep 21 14:43
    aaron-lane labeled #464
  • Sep 21 12:14
    rubans opened #464
Mike Delaney
@madelaney
WIth kitchen-terraform@5.2, is there a way for me to pin the version of azurerm / random that is used during the tests? For example the latest version of azurerm is 2.8.0 but I want to use 1.43.0. Is that possible?
Aaron Lane
@aaron-lane
@madelaney yes, you can do that independently of Kitchen-Terraform. Providers can be pinned with the version argument
You can invoke the module under test with a configuration that pins provider versions and use that configuration as the driver's root_module_directory
Mike Delaney
@madelaney
@aaron-lane Is there an example?
James DeHart
@jamesdehart
Hey all. I have a few very dumb questions. I just started to use kitchen-terraform and looking for examples of tests. I came across this in the issues https://github.com/BensamV/kitchen-terraform-aws/blob/master/02_kitchen_tf/test/integration/extensive_suite/controls/aws_resources.rb#L1
Would love to know where there are docs that explain this line
vpc_id_kt = attribute('vpc_id', description: 'VPC ID')
it seems this variable is set pulling the output from the terraform outputs.tf file but where is the attribute defined? Is that InSpec or Kitchen-Terraform?
Aaron Lane
@aaron-lane
@madelaney not one that I'm aware of, but it's really independent of Kitchen-Terraform, other than setting the root module directory. The root module invoke the module under test along with pinned providers
@describeme Kitchen-Terraform automatically defines InSpec attributes equivalent to the Terraform outputs
Josef
@tbugfinder
How could different logfiled be configured for verify and destroy cycles? My default-aws.log is always overwritten...
Josef
@tbugfinder
And, is it possible to log inspec output also to a file?
Aaron Lane
@aaron-lane
@tbugfinder kitchen may support overriding the log file, but I've never checked. Is
Is the InSpec output not showing in the Kitchen log file?
Aaron Lane
@aaron-lane
Kitchen-Terraform 5.5.0 has been released, with support for Terraform 0.13! https://rubygems.org/gems/kitchen-terraform/versions/5.5.0
Josef
@tbugfinder
Hi, I'm wondering if anybody tried using input*, output* while using module count? I didn't yet, however my understanding is that kitchen-terraform would provide only a single instance of those kv pairs.
Josef
@tbugfinder
Interesting, it's an array and just works.
Hi, next question. While using outputs within a control as input I noticed that keys get prefixed with a ':' which I don't get if the input is loaded from a yml file. @aaron-lane any clue what's going on here?
Josef
@tbugfinder
Fixed by using symbolized keys in my yaml.
Aaron Lane
@aaron-lane
@tbugfinder I'm glad both of those issues were resolved 😅
James Clarke
@jamesp22_gitlab
Hey, is anyone able to help with this - https://stackoverflow.com/questions/64536441/using-terraform-output-in-kitchen-terraform-tests I cant seem to get my terraform outputs to be usable in my tests.
Josef
@tbugfinder
Hi @jamesp22_gitlab , did you try using output_ prefix? It's all setup by kitchen Terraform without mangling around inspec.yml.
I'd also recommend using "new" input() instead of attributes.
James Clarke
@jamesp22_gitlab
Hey, @tbugfinder is there any actual documentation for this/examples of it working? most of what I can find is years old and not relevant, or not clearly explained.
Like, Im not sure were to declare the terraform output? In output.tf in the root, in main.tf in the test/integrations/tf_module, or does there need to be a output.tf there aswell? not entirely sure. Ive tried adding attrs_outputs: to .kitchenyaml and it comes up with - Resolving the system attributes from outputs failed due to the absence of the 'gcloud_project' key from the Terraform outputs in the Kitchen instance state.
Josef
@tbugfinder
Hi @jamesp22_gitlab , hm
Actually I've looked at the PR which added the feature. The output has to be part of the fixture output which could pass all module outputs.
Maybe we should add aPR to docs then.
James Clarke
@jamesp22_gitlab
so does it go in the main.tf in test/integrations/tf_module, or a seperate output.tf file?
Id love to see a working example ha, im sure im just missing something stupid.
Josef
@tbugfinder
I'll create a sample
Just noticed there's already something.
Josef
@tbugfinder
Hi @jamesp22_gitlab Let me know if this code explains it better. https://github.com/tbugfinder/kttfsample
Josef
@tbugfinder
Is there any specific configuration needed in kitchen.yml so that kitchen-terraform loads inspec profiles?
Josef
@tbugfinder
Actually I don't think so 👻
Aaron Lane
@aaron-lane
Nope, but you can specify alternative profiles if you're not using local profiles under test/integration
Josef
@tbugfinder
Hi, I'm wondering if a second verify run should actually also run terraform apply, or if this is by design only executed once?
Aaron Lane
@aaron-lane
That is by design. Kitchen is implemented as a state machine and the commands are cumulative, so when you run verify the first time it implicitly includes converge, but the second time the Kitchen instance is already converged so verify only verifies
@tbugfinder
Aaron Lane
@aaron-lane
@/all v5.6.0 has been released with support for Terraform 0.14.0 🎉
Josef
@tbugfinder
Thank you 👍👍
HAMMOUT
@jhammout
Hello, I'm wondering if i can use kitchen with terragrunt and how?
Josef
@tbugfinder
Hi @jhammout I'm not a terragrunt user but rather a "follower". I think it should be possible given that kitchen-terraform supports lifecycle hooks. So terragrunt would manage the "module code" and kitchen-terraform+terraform the test/fixture. Should terragrunt also manage the test/fixture terraform files or can those be rather static for any terragrunt environment?
Wouldn't you use terratest in terragrunt space?
Aaron Lane
@aaron-lane
@jhammout sorry for the late reply; Gitter for Android seems to have notifications 🤷 you can use the client attribute on the driver configuration to point to a Terragrunt binary rather than a Terraform binary. We actually test using Terragrunt in one of the scenarios to check compatibility
s/have/hate
Aaron Lane
@aaron-lane
v5.7.0 has been released with support for InSpec plugins. Big thanks to @tbugfinder for the implementation!
laboDiabo
@laboDiabo
Hi everyone, first of all thanks for the work on Kitchen-Terraform
Currently implementing it in our process :)
had a question about Terragrunt but I see @aaron-lane already commented something on this. Checking the use of "client" attribute.
@jhammout were you able to implement this?
Aaron Lane
@aaron-lane
v5.8.0 has been released with support for Terraform 0.15!