Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 28 15:15
    aaron-lane closed #411
  • Oct 28 15:15
    aaron-lane commented #411
  • Oct 28 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
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
I think I should just parse the state and make things much easier
Edward Bartholomew
@edwardbartholomew
Thank you for confirmation of being expected. I just wanted to make sure it was me and not the code :) I had started to dig into the source code but got distracted and never returned to it. I think it's fine as-is, but if output is from statefile too, then might be more consistent approach?
Edward Bartholomew
@edwardbartholomew
#378 my documentation PR still stuck on a failing test, not quite sure how to troubleshoot.
Aaron Lane
@aaron-lane
The outputs are from the output command. I have not checked lately if there is a command to display the variable values in a parsable format
Edward Bartholomew
@edwardbartholomew
I don't see any tf command after checking the docs!
Aaron Lane
@aaron-lane
@edwardbartholomew I'm at a resort with very poor WiFi. I'll have to check your tutorial in the new year 😬
@anniehedgie_twitter I'll also try to get some solutions for your issues in the new year as well
Edward Bartholomew
@edwardbartholomew
@aaron-lane Thanks for the update, enjoy your resort, and happy new year!!!
Aaron Lane
@aaron-lane
🎇🎆
Saul Jaramillo
@describeme
hey guys, does any body know if there is any way to skip terraform apply for workspaces other than the default while running test-kitchen (converge, verify) commands
i want to apply the default workspace and then just run tests on it not create an additional workspace that duplicates the infrastructure and run tests on it
Aaron Lane
@aaron-lane
Hey @describeme! #348 tracks a request for that behaviour. Please add any additional information you think could be useful
Aaron Lane
@aaron-lane
Aaron Lane
@aaron-lane
v5.30 has been released!
Josef
@tbugfinder
Meanwhile I've added kitchen-terraform to multiple modules (e.g. vpc, ec2, iam, ...). Usually those modules are integrated into an infrastructure stack. Within inf-stack testing I ended up duplicating parts of the test of modules. Now I'm looking for a decent approach of sharing that inspec test code between modules and module consumers. Any thoughts or links I could start with?
Aaron Lane
@aaron-lane
@tbugfinder you can use the verifier.systems[x].profile_locations attribute to reference remote InSpec profiles
Josef
@tbugfinder
@aaron-lane that looks promising as it also supports git as a source (as per inspec doc). I'll test this and maybe also check what's possible with include_controls.
Josef
@tbugfinder
@aaron-lane I have some difficulties in finding profile_locations within rubydoc.info. Should it be in ConfigAttribute/Systems?
Aaron Lane
@aaron-lane
@tbugfinder sorry to miss your message! Looks like the documentation for profile_locations didn't upload for some reason. An other reason to get off of rubydoc.info. You can find the description here: https://www.github.com/newcontext-oss/kitchen-terraform/tree/master/lib%2Fkitchen%2Fterraform%2Fconfig_schemas%2Fsystem.rb
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