Thanks Adam, I have shared the AMI with AWS account. Now I am able to run "./terraform apply" but I am getting the following error.
May I know what causes the below issue:
aws_instance.lt (remote-exec): Connecting to remote host via SSH...
aws_instance.lt (remote-exec): Host: 34.207.166.254
aws_instance.lt (remote-exec): User: centos
aws_instance.lt (remote-exec): Password: false
aws_instance.lt (remote-exec): Private key: true
aws_instance.lt (remote-exec): SSH Agent: false
aws_instance.lt: Still creating... (10m10s elapsed)
aws_instance.lt: Still creating... (10m20s elapsed)
Error applying plan:
2 error(s) occurred:
* aws_instance.ls: 1 error(s) occurred:
* timeout
* aws_instance.lt: 1 error(s) occurred:
* timeout
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.