Configure AWS cli inside chef cookbook I am working on setting up something with S3 and Chef, I have AWS CLI installed and working but I need to figure out how to specify the access ID and the secret access key. I know there are cookbooks out there for this but I have tried a few with no luck so I am not using anyone else's cookbooks for this project anymore. 

Suggestions on how I can run aws configure and then output the correct value for each of the 4 things it asks?

Code in my script to set env variables:

export AWS_ACCESS_KEY_ID=&lt;key&gt;

export AWS_SECRET_ACCESS_KEY=&lt;secret_key&gt;

export AWS_DEFAULT_REGION=&lt;region&gt;
Have you tried setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables? By setting these variables before you run your cli commands, you should not have to run the aws configure command. 


  Environment Variables 
  
  Environment variables override configuration and
  credential files and can be useful for scripting or temporarily
  setting a named profile as the default.
  The AWS CLI supports the following environment variables.
  
  AWS_ACCESS_KEY_ID – AWS access key.
  
  AWS_SECRET_ACCESS_KEY – AWS secret key. Access and secret key
  variables override credentials stored in credential and config files.
  
  AWS_SESSION_TOKEN – Specify a session token if you are using temporary
  security credentials.
  
  AWS_DEFAULT_REGION – AWS region. This variable overrides the default
  region of the in-use profile, if set.
  
  ....