Creating a swap file on a new partition using Ansible

We are running a project to automate server build on our AWS infrastructure. On a AWS instance, I need to create a swap space as that of memory size of the instance. Any suggestions to use existing modules or I need to write a playbook of my own ?

Thanks & Regards,
Karthik