Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Secret AWS values are not read from config #470

Open
ephracis opened this issue Jun 14, 2016 · 2 comments
Open

Secret AWS values are not read from config #470

ephracis opened this issue Jun 14, 2016 · 2 comments

Comments

@ephracis
Copy link

ephracis commented Jun 14, 2016

Here's my AWS config file:

$ cat $HOME/.aws/config 
[default]
output = table
region = eu-central-1
aws_access_key_id = <REDACTED>
aws_secret_access_key = <REDACTED>

Here's my Vagrantfile:

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

  config.vm.provider :aws do |aws, override|
    aws.keypair_name = 'themisto'
    aws.region = 'eu-central-1'
    aws.instance_type = 't2.micro'
    aws.security_groups = ['vagrant']
    aws.ami = 'ami-f9e30f96' # Ubuntu 16.04, EU (Frankfurt), hvm:instance-store

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

  config.vm.provision 'chef_client' do |chef|
    chef.node_name = 'dev-web'
    chef.chef_server_url = 'https://api.chef.io/organizations/simplare'
    chef.validation_key_path = '.chef/simplare-validator.pem'
    chef.validation_client_name = 'simplare-validator'
    chef.add_recipe 'simplare-base'
    # chef.add_role 'web'
    # chef.environment = 'development'
    chef.delete_node = true
    chef.delete_client = true
  end
end

According to the README:

Note: if you don't configure aws.access_key_id or aws_secret_access_key it will attempt to read credentials from environment variables first and then from $HOME/.aws/.

But...

$ vagrant up
There are errors in the configuration of this machine. Please fix
the following errors and try again:

AWS Provider:
* An access key ID must be specified via "access_key_id"
* A secret access key is required via "secret_access_key"

Same error when I set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Seems that the Vagrantfile MUST contain the two parameters, contrary to what the README specifies.

Some info:

$ vagrant plugin list
vagrant-aws (0.7.0)
vagrant-share (1.1.5, system)

$ vagrant --version
Vagrant 1.8.1

$ ruby --version
ruby 2.3.0p7 (2016-01-21 revision 53608) [x86_64-darwin15]
@asebastian-r7
Copy link

This is because you are using version 0.7.0, released prior to the changes which enabled the credentials chain. Those are in master and unreleased.

@rtyler can we get a new release? Last release was January 4th and there are some nice improvements we can be using. Are you still a maintainer?

@kenorb
Copy link

kenorb commented Jun 26, 2016

Fixed in PR #441, duplicated of: #151

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants