vagrant + aws:下载'dummy'时出错

时间:2016-10-14 19:35:11

标签: amazon-web-services amazon-ec2 vagrant vagrantfile

我确实使用了https://github.com/mitchellh/vagrant-aws给出的入门默认值。我设置访问/密钥+密钥对以使用环境变量:

Vagrant.configure("2") do |config|
  config.vm.box = "dummy"

  config.vm.provider :aws do |aws, override|
    aws.access_key_id = ENV['AWS_ACCESS_KEY']
    aws.secret_access_key = ENV['AWS_SECRET_KEY']
    #aws.session_token = "SESSION TOKEN"
    aws.keypair_name = ENV['AWS_KEYPAIR']

    aws.ami = "ami-7747d01e"

    override.ssh.username = "ubuntu"
    override.ssh.private_key_path = "~/.ssh/id_rsa"
  end
end

我运行vagrant up --provider=aws

Bringing machine 'default' up with 'aws' provider...
==> default: Box 'dummy' could not be found. Attempting to find and install...
    default: Box Provider: aws
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'dummy' (v0) for provider: aws
    default: Downloading: dummy
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/username/vagrants/ec2test/dummy

2 个答案:

答案 0 :(得分:1)

你需要添加dummy框,vagrant将无法找到此框并从图集中下载。

请务必自行添加该框

vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box

在此之后,它会更好用

答案 1 :(得分:1)

要获得更便携的解决方案,请将此行添加到您的配置中(在config.vm.box下面):

config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"