2

Packer build fails with:

amazon-ebs: error validating regions: AuthFailure: AWS was not able to validate the provided access credentials

I severally encountered the above error while trying build an AMI on AWS. My template contains the necessary variable exported called with the env packer keyword.

Samuel
  • 31
  • 6

2 Answers2

2

I had the same problem and couldn't find out what was wrong.

Then I tried terraform to test the credentials, the message was a bit better and mentioned something about clock, so I restarted the Windows and got the problem ""fixed"".

1

It appeared that the credentials were not passed to packer at run time hence the failure. use the "profile":"your aws profile" builder key and pass in your aws profile as value. then export AWS_SHARED_CREDENTIALS_FILE=~/.aws/credentials and run your packer build command. This approach seems more neater than using the

"access_key": "{{user `AWS_ACCESS_KEY_ID`}}",
"secret_key": "{{user `AWS_SECRET_ACCESS_KEY`}}",
Samuel
  • 31
  • 6