Creating AWS infrastructure ( CloudFront + S3+ EC2 Instances) using the Terraform tool with the HCL(HashiCorp Language) scripts and ansible engine is used for infrastructure configuration management.

Pre-requisites:- Preconfigured AWS CLI, ansible engine, Terraform CLI, IAM-user with administrative powers.

So, our tree and ansible.cfg file looks like.

Ansible playbook

Here, we are using a template file for creating our inventory file of the ansible hosts so that we can create inventory file as per our requirement.

So, now we can create our resources to build our infrastructure.

As terraform work on the declarative approach, so we can create or destroy our infrastructure from the same Infrastructure-as-code [IAC].

For destroying everything created by Terraform.

For any correction and any query, follow our Github repo.

I'm a computer science undergraduate and my primary area of work is under Linux, CloudComputing, DevOps culture, and various open-source tools and technologies