I can run EC2 instances using the following code. The Public DNSs (IPs) will be in demogroup .
demogroup
- hosts: localhost gather_facts: no vars_files: