Skip to content

Instantly share code, notes, and snippets.

@daicham
Created July 15, 2014 03:57
Show Gist options
  • Save daicham/75eda77132cf5eca6902 to your computer and use it in GitHub Desktop.
Save daicham/75eda77132cf5eca6902 to your computer and use it in GitHub Desktop.
Vagrantfile for ec2
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
aws.access_key_id = 'accesskeyid'
aws.secret_access_key = 'secretaccesskey'
aws.keypair_name = "keypairname"
aws.region = "ap-northeast-1" # Tokyo Region
aws.instance_type = "t1.micro"
aws.ami = "ami-25dd9324" # Amazon Linux AMI 2014.03.2 (PV)
aws.security_groups = ['ssh'] # ssh を許可する sg を指定する
aws.tags = { 'Name' => 'vagrant_test'}
## vagrant が ssh する際の設定を上書き
override.ssh.username = 'ec2-user'
override.ssh.private_key_path = '~/.ssh/aws.pem'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment