Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS credentials not passing through to Vagrant box #482

Open
jmvbxx opened this issue Jan 21, 2023 · 1 comment
Open

AWS credentials not passing through to Vagrant box #482

jmvbxx opened this issue Jan 21, 2023 · 1 comment

Comments

@jmvbxx
Copy link

jmvbxx commented Jan 21, 2023

🗣️ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

👻 Brief Description

When spinning up a new Vagrant box, the AWS credentials are not being properly passed to the Vagrant box resulting in errors such as the following when trying to access SSM parameters

Aws::Errors::MissingCredentialsError
------------------------------------
unable to sign request without credentials set

Version

kitchen-vagrant 1.13.0

Environment

Here are some specs about the overall environment:

  • Workstation OS: Ubuntu 22.04
  • Vagrant v2.3.4
  • bento/amazonlinux-2 v1.3

Scenario

I'm trying to access AWS resources from within the Vagrant box and am unable to do so

Steps to Reproduce

Here is the configuration I'm using:

driver:
  name: vagrant
  env:
    - AWS_REGION=<%= ENV['AWS_REGION'] %>
    - AWS_ACCESS_KEY_ID=<%= ENV['AWS_ACCESS_KEY_ID'] %>
    - AWS_SECRET_ACCESS_KEY=<%= ENV['AWS_SECRET_ACCESS_KEY'] %>
    - AWS_SESSION_TOKEN=<%= ENV['AWS_SESSION_TOKEN'] %>

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: amazonlinux
    driver:
      box: bento/amazonlinux-2

I run the following command: bundle exec kitchen converge default-amazonlinux

Everything runs correctly, the box spins up and the Chef run begins and then I get the following error Error executing action get on resource 'aws_ssm_parameter_store along with the error already shared above.

Expected Result

A successful Chef run

Actual Result

Error executing action get on resource 'aws_ssm_parameter_store

Aws::Errors::MissingCredentialsError
------------------------------------
unable to sign request without credentials set

Thanks in advance for any help/guidance.

@jmvbxx
Copy link
Author

jmvbxx commented Jan 21, 2023

Btw, the same happens if I use aws-vault and remove the env block under driver. For example:

driver:
  name: vagrant

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: amazonlinux
    driver:
      box: bento/amazonlinux-2

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

No branches or pull requests

1 participant