1

I want to take aws credentials from the aws-vault exec environment and store them in a file

When I try to print the credentials with aws-vault exec default -- echo ${AWS_ACCESS_KEY_ID} I got only an empty string

Stoyan Georgiev
  • 345
  • 2
  • 8

1 Answers1

2

As per aws-vault : How it works,

Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN etc.) are written to the sub-process with aws-vault exec, so you can grep out for AWS_SECRET_ACCESS_KEY like below:-

aws-vault exec default -- env | grep AWS_SECRET_ACCESS_KEY
Arpit Jain
  • 1,599
  • 9
  • 23