Ansible has one module named ec2. This is a module that is used to connect AWS using the Ansible-Playbook. I have attached one playbook below for your reference.
- hosts: localhost
- name: AWS OS provisioning
image: <Replace with Ubuntu AMI>