This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI.
On Project Settings > Environment Variables add this keys:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
The aws user must have the right permissions. This can be hard, maybe, this can help you.