vagrant-awsの0.6.0では、rsyncに失敗するので、明示的に0.5.0をインストールする。
vagrant plugin install vagrant-aws --plugin-version 0.5.0
Vagrantfileは下記を参照。
このままだと下記のWarningが出るので、
DEPRECATION WARNING: called deprecated method `access_key_id' of an Aws::CredentialProvider, use #credentials instead
DEPRECATION WARNING: called deprecated method `secret_access_key' of an Aws::CredentialProvider, use #credentials instead
下記のように修正。
Vagrantfile
require "aws-sdk";
credentials = Aws::SharedCredentials.new
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
aws.access_key_id = credentials.credentials.access_key_id
aws.secret_access_key = credentials.credentials.secret_access_key
aws.region = 'ap-northeast-1'
aws.instance_type = 't2.micro'
aws.ami = 'ami-cbf90ecb'
aws.security_groups = ['test_group']
aws.keypair_name = 'test_key'
aws.tags = {
'Name' => 'test-vagrant'
}
override.ssh.username = "ec2-user"
override.ssh.private_key_path = 'sshkeyfile'
override.ssh.pty = true
end
end