step1: Create <file_name>.tf
paste below code
module "terraformansible" {
source = "MDMOQADDAS/terraformansible/aws"
version = "1.0.1"
}
terraform init
Step3: Go inside
cd .terraform/modules/terraformansible/
Example
Step4: Run Below Command
pwd
Example
Step5: Copy above command output and open variables.tf
file
vim variables.tf
Change AMI Id, Instnce type, key name and path of module
Step6: Open ansible.cfg
file and replace private_key_file
Step7: Now you good to go come back to folder and Run Command
cd ../../../
terraform apply