System Provisioning Management Tool

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. It provides Infrastructure as code allowing you to automate and manage your cloud, infrastructure, platform and your services that run on the platform. Terraform can manage existing and popular service providers(AWS, Azure, GCP etc.)

Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied.

The infrastructure Terraform can manage includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc.

Terraform is declarative which means you define what you want.

Steps for AWS Cloud Provisioning

  1. We take into account that Terraform is already installed on your Machine.
  2. Now, setup a connection to AWS using the access key and secret key which you can create and download from your AWS management console by clicking on your name> security credentials> access keys:

3. Now, create a file using vim which is will connect to AWS and has the access and security key credentials which you have downloaded and enter your region:

4. Then using vim create a file in terraform with .tf extension and add below commands and set the ami from the screen as shown below and set the instance type as t2 micro and key_name as “mykey”:

In this file, we add resources like instance creation, vpn and S3 bucket. All these steps to create these 3 added in this file.

5 main Terraform commands to provision on AWS:

Now run the following commands

  1. terraform init

It initializes working directory containing terraform configuration files(.tf files) and it is safe to run this command multiple times.

2. terraform validate

It checks if terraform scripts have no syntax errors and are internally consistent.

3. terraform plan

It create execution plan that helps you check whether execution plan matches your expectations.

4. terraform apply

It applies changes to reach the desired state of the configuration.

5. terraform destroy

It terminates resources defined in your Terraform configuration.

Now you can check the instances, VPN and S3 bucket have been created on your AWS cloud:

For knowing more about Terraform, you can refer to the online content or check various YouTube videos available online.