Credentials error in Chef Provisioning AWS

Greetings masters

After reading all opinions in Best approach to create AWS VPC, NAT, EC2 instances using chef 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 '’
internet_gateway true
aws_tags chef=> 'my_vpc’

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

Any guidance?

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

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

I double checked my credentials. They are fine.