Skip to content

Instantly share code, notes, and snippets.

@skiold
Created October 8, 2013 10:28
Show Gist options
  • Save skiold/6882711 to your computer and use it in GitHub Desktop.
Save skiold/6882711 to your computer and use it in GitHub Desktop.
Vagrantfile for vagrant-aws using ami that depends on a ec2-user (fix requiretty in sudo)
Vagrant.configure("2") do |config|
config.vm.provider :aws do |aws, override|
aws.access_key_id = "#{ENV['AWS_ACCESS_KEY']}"
aws.secret_access_key = "#{ENV['AWS_SECRET_KEY']}"
aws.keypair_name = "your keypair id"
end
end
Vagrant.configure("2") do |config|
config.vm.box = "dummyec2"
config.vm.provider :aws do |aws, override|
aws.ami = "ami-3c034f6e"
aws.region = "ap-southeast-1"
aws.user_data = "#!/bin/bash\necho 'Defaults:ec2-user !requiretty' > /etc/sudoers.d/999-vagrant-cloud-init-requiretty && chmod 440 /etc/sudoers.d/999-vagrant-cloud-init-requiretty"
override.ssh.username = "ec2-user"
override.ssh.private_key_path = "/home/adrians/.ssh/id_rsa_nfs"
end
end
@skiold
Copy link
Author

skiold commented Oct 8, 2013

The first one is to share aws auth credentials between projects.

Place something like that in your ~/.vagrant.d/Vagrantfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment