# AWS profile not found

**URL:** <https://forum.ansible.com/t/aws-profile-not-found/24800>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 22, 2017, 10:43am UTC](https://forum.ansible.com/t/aws-profile-not-found/24800 "2017-06-22T10:43:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![B\_Holmes](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@B\_Holmes](https://forum.ansible.com/u/B_Holmes)\
**Post date:** [June 22, 2017, 10:43am UTC](https://forum.ansible.com/t/aws-profile-not-found/24800/1 "2017-06-22T10:43:02Z")

</div>

Hi,

I’m having trouble authenticating to AWS using a profile. My ~/.aws/credentials file has a profile named production:

`  
[default]  
aws\_access\_key\_id = \<some\_key\>  
aws\_secret\_access\_key = \<some\_secret\>  
region = eu-west-1

[production]  
aws\_access\_key\_id = \<my\_key\>  
aws\_secret\_access\_key = \<my\_secret\>  
region = eu-west-1  
`

Boto can see it:

`  
import boto3

session = boto3.Session(profile\_name=‘production’)  
session.available\_profiles

Out[7]:  
[‘default’,  
‘production’]  
`

Yet while this playbook works fine:

`

- name: example ec2 group  
ec2\_group:  
name: example2  
description: an example EC2 group  
region: eu-west-1  
**aws\_secret\_key: \<my\_key\>**  
**aws\_access\_key: \<my\_secret\>**  
rules:  
`

this one errors:

`

- name: example ec2 group  
ec2\_group:  
name: example2  
description: an example EC2 group  
**profile** \*\*: production\*\*  
region: eu-west-1  
rules:  
`

`An exception occurred during task execution. To see the full traceback, use -vvv. **The error was: boto.provider.ProfileNotFoundError: Profile "production" not found!** `

Anyone seen this before? If ~/.aws/credentials isn’t being checked, what file is?

Many thanks.

---

<div class="post-metadata">

**Author:** ![B\_Holmes](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@B\_Holmes](https://forum.ansible.com/u/B_Holmes)\
**Post date:** [June 22, 2017, 11:06am UTC](https://forum.ansible.com/t/aws-profile-not-found/24800/2 "2017-06-22T11:06:52Z")

</div>

Fixed. Had become: True in my build.yml so it was looking for root’s credentials file /root/.aws/credentials
