# How to run a playbook or command against AWS

**URL:** <https://forum.ansible.com/t/how-to-run-a-playbook-or-command-against-aws/29613>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [February 4, 2019, 6:19pm UTC](https://forum.ansible.com/t/how-to-run-a-playbook-or-command-against-aws/29613 "2019-02-04T18:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Greenberg](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Ed\_Greenberg](https://forum.ansible.com/u/Ed_Greenberg)\
**Post date:** [February 4, 2019, 6:19pm UTC](https://forum.ansible.com/t/how-to-run-a-playbook-or-command-against-aws/29613/1 "2019-02-04T18:19:27Z")

</div>

So I have my AWS ACCESS and SECRET keys sitting in environment variables.

I have Ansible working, and BOTO installed.

I have this little playbook:

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [February 4, 2019, 6:23pm UTC](https://forum.ansible.com/t/how-to-run-a-playbook-or-command-against-aws/29613/2 "2019-02-04T18:23:03Z")

</div>

since you are targetting the API and not a specific host you need connection: local and hosts: localhost
