# Use ansible/AWX authentication to awscli with an attached iam-role on instance

**URL:** <https://forum.ansible.com/t/use-ansible-awx-authentication-to-awscli-with-an-attached-iam-role-on-instance/32172>\
**Category:** AWX Project\
**Tags:** aws, awx\
**Created:** [February 7, 2020, 9:09am UTC](https://forum.ansible.com/t/use-ansible-awx-authentication-to-awscli-with-an-attached-iam-role-on-instance/32172 "2020-02-07T09:09:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carsten\_Burger](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Carsten\_Burger](https://forum.ansible.com/u/Carsten_Burger)\
**Post date:** [February 7, 2020, 9:09am UTC](https://forum.ansible.com/t/use-ansible-awx-authentication-to-awscli-with-an-attached-iam-role-on-instance/32172/1 "2020-02-07T09:09:51Z")

</div>

Hello @ll,

we use ansible / AWX in AWS.  
For security we have IAM-Roles attached to the AWX instance.

Now I want to get the data of the instances from multiple AWS-accounts with ansible template to create Snapshots for backup of a part of instances.

We have in ~/.aws/config many profiles like this:

`  
[profile xxx]  
region = eu-central-1  
role\_arn = xxx  
credential\_source = Ec2InstanceMetadata  
output = text

`

If we use the awscli command line, the connection to the AWS-accounts is available and the result is right.

If i use the playbook, we don’t get Errors but always no result, because there is no connection.

Playbook:

`

---

<div class="post-metadata">

**Author:** ![Carsten\_Burger](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Carsten\_Burger](https://forum.ansible.com/u/Carsten_Burger)\
**Post date:** [February 10, 2020, 6:26am UTC](https://forum.ansible.com/t/use-ansible-awx-authentication-to-awscli-with-an-attached-iam-role-on-instance/32172/2 "2020-02-10T06:26:31Z")

</div>

Has nobody an Idea?

---

<div class="post-metadata">

**Author:** ![sdmorel](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sdmorel](https://forum.ansible.com/u/sdmorel)\
**Post date:** [February 13, 2020, 8:18am UTC](https://forum.ansible.com/t/use-ansible-awx-authentication-to-awscli-with-an-attached-iam-role-on-instance/32172/3 "2020-02-13T08:18:47Z")

</div>

Hi,

Do you have your ~/.aws/config file inside the web and task container?  
Notice the awx user home is /var/lib/awx
