AWS profile not found

228 views
Skip to first unread message

B Holmes

unread,
Jun 22, 2017, 6:43:02 AM6/22/17
to Ansible Project
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.

B Holmes

unread,
Jun 22, 2017, 7:06:52 AM6/22/17
to Ansible Project
Fixed.  Had become: True in my build.yml so it was looking for root's credentials file /root/.aws/credentials
Reply all
Reply to author
Forward
0 new messages