AWS, Cloud Computing, DevOps

6 Mins Read

Step-by-Step Guide to Manage Infrastructure on AWS using Terraform Cloud for FREE

Hello everyone, welcome back! In this article, you will learn how to write, plan, and maintain infrastructure using Terraform cloud.

Let us start with a brief about the Terraform cloud.

Terraform cloud is a self-hosted SaaS product that provides services to help teams and organizations collaborate, manage, maintain a consistent environment, and most importantly, automate the process and work as a team.

This article focuses on guiding individuals to step into the Terraform cloud. We will see how we can create a workspace and integrate it with the version control system to maintain the infra from Terraform cloud graphics.

So, let us go forward and use the Terraform Cloud.

Prerequisites:

To go further with Terraform cloud, you need to have GitHub and AWS Account.

Configure variables

Now we created our workspace and connected to the VCS. Let us plan and apply the files.

Our workspace contains two files, namely instance.tf and vars.tf. We are going to deploy an EC2 machine on AWS.

The snippet of the files is as below:

instance.tf

9
vars.tf
10

We are using two variables in the provider section to pass the AWS Account access key and secret key. These credentials are used to authenticate with AWS. It is not acceptable to hardcode them directly on the configuration as it is highly open to risk as it is sensitive data. Instead, we can pass as a variable.

In Terraform, we pass the sensitive data in 2 ways:

a. Using Command-line: Sensitive data is recommended to be stored in *.tfvars file that will be git ignored.
b. From Terraform Cloud: we can add a variable in a secured manner. let’s have a look at it

Now on the terraform cloud graphics, click Configure variables. In this demo, we will pass the credentials of AWS (Access key and secret key) to authenticate with users.

Click on + Add variable and provide the following details. Make sure you enable the sensitive check box.

Table

    • Once completed, check the run tab to check the status.27
    • Check the AWS console to verify that the resources are no longer active.

Conclusion:

I hope that you have learned how to integrate the VCS to the Terraform cloud. We have seen how to manage the infrastructure easily from the graphics. Hope that this blog helps to get started with Terraform cloud. Follow for more updates on DevOps related information.

Drop your queries in the comments section below.

Voiced by Amazon Polly

WRITTEN BY Shyla J

Shyla is an MCT and works on cloud platforms like AWS and Azure. She is certified as an Azure Administrator and works on DevOps tools like Ansible, and Terraform, to create and deploy highly available infrastructure on AWS and Azure.

SHARE

Comments

  1. Anusha Shanbhag

    Dec 9, 2020

    Reply

    Very nice blog. Informative.

  2. Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!