0

I am trying to implement a local testing environment for our windows chef cookbooks using vagrant/test kitchen. Inside of our cookbooks we have some recipes that need authentication information for AWS. Each dev has their personal aws authentication information on their local machine.

How do I import the local AWS credentials onto the vagrant box with the kitchen.yml file?

  • Does it help that you can read environment variables within the `.kitchen.yml` using `<%= ENV['VAR_NAME'] %>` to pass this as attribute? Further, you could directly set it in a `.kitchen.local.yml` which isn't stored in VCS. – StephenKing Aug 31 '15 at 20:30
  • I know of those methods, but don't know how to leverage them in a way to get the local credentials onto the windows vagrant box. The only method I know how to do it right now is by putting some code into a Vagrantfile that would grab the local credentials(which we don't want to do) or by having a box with the credentials baked in. Do you have an example of the methods you talked about that would push the aws credentials onto the box? – user3613443 Aug 31 '15 at 21:51
  • write a recipe that takes in those values as attributes and sets the local environment variables; set the attributes as @StephenKing suggested in your `.kitchen.yml` file to get them from the host machine. for your actual local development environment, in the Vagrantfile you'd do the same thing in your chef provisioner's `chef.json` object. – Derek Sep 03 '15 at 03:02
  • I want to know if there is a way to dynamically pull in those values onto the local dev environment via the `.kitchen.yml` file – user3613443 Sep 08 '15 at 21:30

0 Answers0