# Credentials error in Chef Provisioning AWS

**URL:** https://discourse.chef.io/t/credentials-error-in-chef-provisioning-aws/8968
**Category:** Chef Infra (archive)
**Created:** [July 19, 2016, 3:50am UTC](https://discourse.chef.io/t/credentials-error-in-chef-provisioning-aws/8968 "2016-07-19T03:50:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![manishmehra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/manishmehra/32/1484_2.png) [@manishmehra](https://discourse.chef.io/u/manishmehra)
#### Post date: [July 19, 2016, 3:50am UTC](https://discourse.chef.io/t/credentials-error-in-chef-provisioning-aws/8968/1 "2016-07-19T03:50:40Z")

</div>

Greetings masters

After reading all opinions in [Best approach to create AWS VPC, NAT, EC2 instances using chef - #15 by sme](https://discourse.chef.io/t/best-approach-to-create-aws-vpc-nat-ec2-instances-using-chef/8919/15) thread, I decided to give Chef provisoning a try. But here I am stuck with following error:

> 

Chef::Provisioning::AWSDriver::LoadCredentialsError: Could not load credentials from the environment variables, the .aws/credentials file or the metadata service.

My recipe is pretty straight forward.

> 

require 'chef/provisioning/aws\_driver'  
require 'chef/provisioning/aws\_driver/aws\_resource'  
with\_driver 'aws::eu-west-1'  
aws\_vpc 'test\_vpc' do  
cidr\_block '172.29.0.0/16'  
internet\_gateway true  
aws\_tags chef=\> 'my\_vpc'  
end

> 

I have created ~/.aws/config and ~/.aws/credentials files as well.

Any guidance?

---

<div class="post-metadata">

### Author: ![okram999](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/okram999/32/1083_2.png) [@okram999](https://discourse.chef.io/u/okram999)
#### Post date: [July 19, 2016, 3:42pm UTC](https://discourse.chef.io/t/credentials-error-in-chef-provisioning-aws/8968/2 "2016-07-19T15:42:54Z")

</div>

not sure about the syntax in your script, but the error and

> <https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/credentials2.rb>

seems to be point to the fact that, its not able to get your IAM credentias  
to interact with AWS. If you have them in the ~/.aws/credentials file, make  
sure their is no wrong credential set in the env variable . if there are  
try removing them

---

<div class="post-metadata">

### Author: ![manishmehra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/manishmehra/32/1484_2.png) [@manishmehra](https://discourse.chef.io/u/manishmehra)
#### Post date: [July 20, 2016, 6:48am UTC](https://discourse.chef.io/t/credentials-error-in-chef-provisioning-aws/8968/3 "2016-07-20T06:48:22Z")

</div>

I double checked my credentials. They are fine.
