Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created January 15, 2015 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheldonh/2b002fb15070716693cb to your computer and use it in GitHub Desktop.
Save sheldonh/2b002fb15070716693cb to your computer and use it in GitHub Desktop.
Running test-kitchen from an EC2 instance
<%
require 'json'
require 'net/http'
json = Net::HTTP.get('169.254.169.254', '/latest/meta-data/iam/security-credentials/chef-lab-workstation')
creds = JSON.parse(json)
%>---
driver:
name: ec2
aws_access_key_id: <%= creds["AccessKeyId"] %>
aws_secret_access_key: <%= creds["SecretAccessKey"] %>
aws_session_token: <%= creds["Token"] %>
aws_ssh_key_id: chef-lab
ssh_key: <%= ENV['HOME'] %>/.ssh/chef-lab.pem
subnet_id: subnet-3eb66215
vpc_id: vpc-1cf49679
security_group_ids:
- sg-506fa434
require_chef_omnibus: true
provisioner:
name: chef_solo
platforms:
- name: ubuntu-14.04
driver:
image_id: ami-9eaa1cf6
username: ubuntu
flavor_id: t2.micro
suites:
- name: default
run_list:
- recipe[apt-upgrade-once::default]
- recipe[external_cookbook::reboot-if-required]
- recipe[reboot-handler]
- recipe[getting-started::default]
attributes:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment