I’m running a local Ubuntu 14.04 VM with Chef 11.10 via Test Kitchen. I want to sync files between an AWS S3 bucket and my local directory via ‘aws s3 sync’ but “kitchen converge” keeps erroring out stating “Unable to locate credentials”. However, I’m able to su and run the command successfully via the CLI (within the VM).
Here is the code in question (in my recipe):
bash ‘Sync WordPress content from S3 bucket’ do
user 'anyperk’
cwd '/home/anyperk/'
code <<-EOH
aws s3 sync --region us-west-1 s3://path/to/bucket/ .
EOH
end
And here is the error output: