# ansible using lambda module

**URL:** <https://forum.ansible.com/t/ansible-using-lambda-module/29979>\
**Category:** Ansible Developer\
**Created:** [March 25, 2019, 5:24pm UTC](https://forum.ansible.com/t/ansible-using-lambda-module/29979 "2019-03-25T17:24:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qasim\_sahi](https://avatars.discourse-cdn.com/v4/letter/q/a9a28c/32.png) [@qasim\_sahi](https://forum.ansible.com/u/qasim_sahi)\
**Post date:** [March 25, 2019, 5:24pm UTC](https://forum.ansible.com/t/ansible-using-lambda-module/29979/1 "2019-03-25T17:24:49Z")

</div>

Hi,

can someone please help in creating the playbook to stop/start EC2 instance using lambda ?

---

<div class="post-metadata">

**Author:** ![ipitythaphool](https://avatars.discourse-cdn.com/v4/letter/i/6de8d8/32.png) [@ipitythaphool](https://forum.ansible.com/u/ipitythaphool)\
**Post date:** [March 26, 2019, 7:58pm UTC](https://forum.ansible.com/t/ansible-using-lambda-module/29979/2 "2019-03-26T19:58:38Z")

</div>

What you're asking is kind of confusing.  
If your want or need to run a playbook to do it then you can do both with the EC2 module.

[https://docs.ansible.com/ansible/latest/modules/ec2\_module.html](https://docs.ansible.com/ansible/latest/modules/ec2_module.html)

Otherwise you need to lookup the AWS python/boto (or whatever your language of choice is) doco, and write the appropriate code/policies for your lambda. Once you've tested it, you can then use a playbook and the lambda module etc to deploy a lambda, create triggers and schedules etc
