Hi@Shashi,
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
tasks:
- name: AWS OS provisioning
ec2:
key_name: keymlops
instance_type: t2.micro
image: <Replace with Ubuntu AMI>
wait: yes
region: ap-south-1
group_id: sg-01a7d863
count: 1
vpc_subnet_id: subnet-51167d1d
assign_public_ip: yes
aws_access_key:
aws_secret_key: