Skip to content

Unable to authenticate via aws_iam method #191

Description

@adoyleplm

I am unable to authenticate via the aws_iam method, using a slightly altered example from this code's inline comments:

# VAULT_ADDR set in env

irb(main):008:0> vault_token = Vault.auth.aws_iam(role="my_role", credentials_provider=Aws::InstanceProfileCredentials.new, route="my_route")
Vault::MissingTokenError: Missing Vault token! I cannot make requests to Vault without a token. Please
set a Vault token in the client:

    Vault.token = "42d1dee5-eb6e-102c-8d23-cc3ba875da51"

or authenticate with Vault using the Vault CLI:

    $ vault auth ...

or set the environment variable $VAULT_TOKEN to the token value:

    $ export VAULT_TOKEN="..."

Please refer to the documentation for more examples.

	from /usr/local/share/ruby/gems/2.0/gems/vault-0.12.0/lib/vault/client.rb:381:in `error'
	from /usr/local/share/ruby/gems/2.0/gems/vault-0.12.0/lib/vault/client.rb:291:in `request'
	from /usr/local/share/ruby/gems/2.0/gems/vault-0.12.0/lib/vault/client.rb:197:in `post'
	from /usr/local/share/ruby/gems/2.0/gems/vault-0.12.0/lib/vault/api/auth.rb:242:in `aws_iam'
	from (irb):8
	from /usr/bin/irb:12:in `<main>'

I am able to authenticate manually via the Vault CLI with IAM authentication.

Using latest Amazon Linux AMI with default Ruby.

ami-023c8dbf8268fb3ca

Ruby and Gems:

ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

aws-eventstream (1.0.1)
aws-partitions (1.116.0)
aws-sdk-core (3.39.0)
aws-sdk-ec2 (1.59.0)
aws-sigv4 (1.0.3)
vault (0.12.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions