【问题标题】:vagrant-aws: AWS was not able to validate the provided access credentialsvagrant-aws:AWS 无法验证提供的访问凭证
【发布时间】:2018-05-23 06:51:07
【问题描述】:

我在 Windows 10 上,并使用 vagrant-aws (https://github.com/mitchellh/vagrant-aws) 进行 vagrant up 和 amazon 实例,并收到以下错误。我也列出了我的 Vagrant 文件。

此外,有些人报告这可能是由时间造成的。我已经在 Windows 10 上同步了系统时间,但仍然没有运气!

$ vagrant up --provider=aws
Bringing machine 'default' up with 'aws' provider...
C:/Users/jacky/.vagrant.d/gems/gems/vagrant-aws-0.7.0/lib/vagrant-aws/action/run_instance.rb:98: warning: duplicated key at line 100 ignored: :associate_public_ip
==> default: Warning! The AWS provider doesn't support any of the Vagrant
==> default: high-level network configurations (`config.vm.network`). They
==> default: will be silently ignored.
==> default: Launching an instance with the following settings...
==> default:  -- Type: m3.medium
==> default:  -- AMI: ami-42116522
==> default:  -- Region: us-west-1
==> default:  -- Keypair: 2016_05_14_keypair
==> default:  -- Block Device Mapping: []
==> default:  -- Terminate On Shutdown: false
==> default:  -- Monitoring: false
==> default:  -- EBS optimized: false
==> default:  -- Source Destination check:
==> default:  -- Assigning a public IP address in a VPC: false
==> default:  -- VPC tenancy specification: default
There was an error talking to AWS. The error message is shown
below:

AuthFailure => AWS was not able to validate the provided access credentials

Vagrang 文件:

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

  config.vm.provider :aws do |aws, override|
    aws.access_key_id = "..."
    aws.secret_access_key = "..."
    aws.session_token = "..."
    aws.keypair_name = "2016_05_14_keypair"

    aws.ami = "ami-42116522"
    aws.region  = "us-west-1"
    #aws.instance_type = "t2.small"
    override.ssh.username = "ubuntu"
    override.ssh.private_key_path = "C:/2016_05_14_keypair.pem"
  end
end

【问题讨论】:

  • 我通过凭据进行了仔细检查,所有这些都是正确的。
  • 你是如何生成你的 session_token 的?
  • aws sts get-session-token --duration-seconds 129600
  • 你的 VagrantFile 看起来是正确的 wrt wrt 凭据。我自己也在使用类似的东西,除了我没有使用令牌。您可能想使用aws cli 之类的东西来使用您的凭证创建一个实例,这肯定会排除您的密钥/令牌的问题......
  • @ChristopheSchmitz,你能告诉男人完整的命令吗?

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


【解决方案1】:

我知道这对你来说可能有点晚了。我的 Vagrant 文件与您的文件相同,我遇到了与您相同的问题,我已通过删除“aws.session_token =”行解决了这个问题。

【讨论】:

    【解决方案2】:

    我的解决方案更简单。我将地区名称中的“US”大写 - 区分大小写 - 哦!

    【讨论】:

      猜你喜欢
      • 2015-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 2020-11-21
      相关资源
      最近更新 更多