Use Terraform to launch 3 EC2 instances, where one will be the master with Ansible installed and the others will be the target nodes with the following:
Create the infrastructure with terraform
Configure the master node to access targets by SSH
Configure worker nodes
Prerequisite: Terraform installed
AWS CLI installed and configured