Terraform Setup on Windows to create AWS resources

Let us see how can we setup Terraform CLI on Windows and create some resouces on AWS cloud.

Step 1: Download terraform from https://www.terraform.io/downloads.html

Step 2: Unzip the file and place it in desired location

Step 3: Set path in System Environment Variables

Step 4: Test the installation CMD prompt

Step 5: Configuring and Creating a resource

Make sure AWS CLI is installed and aws configuration done wth $ aws configure command. This will create .aws folder in your C:\Users\username directory

Let us create a resource like an S3 bucket!

Create myexample.tf file

$ terraform init command which initializes various local settings and data that will be used by subsequent commands.

The terraform init command will automatically download and install any Provider binary for the providers in use within the configuration, which in this case is just the aws provider:

$ terraform apply command

In the same directory as the example.tf file you created, run terraform apply.

This output shows the execution plan, describing which actions Terraform will take in order to change real infrastructure to match the configuration. 

Provide input as YES to apply the execution plan of creating the bucket

Check your AWS S3 console to verify

Yup, there you go!!

Any questions? Please comment below!

Advertisements

One thought on “Terraform Setup on Windows to create AWS resources

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s