Prerequisites for Terraform: Getting Started

Before diving into the exciting world of Terraform, it's essential to ensure your local environment is properly set up. This section will guide you through installing the necessary tools and configuring your AWS access, preparing your workspace for seamless infrastructure management. A well-prepared environment is key to a smooth and successful lab experience.
Secure Your Access: AWS Credentials
Terraform needs AWS credentials to manage resources in your account.
In security credentials, you can get your access key and secret key.
Once you have your credentials, open your command prompt or terminal and type aws configure
. Follow the prompts to provide your AWS Access Key ID and AWS Secret Access Key.
If aws configure
does not respond properly or is not recognized, it indicates that the AWS Command Line Interface (AWS CLI) is not installed or not correctly added to your system's PATH. In that case, you will need to install the AWS CLI first.
Equip Your Toolkit: Install Terraform
Go to the official Terraform documentation.
Click the “Download” button next to
amd64
for your operating system (e.g., Windows, macOS, Linux). This will download a.zip
file.Locate the downloaded
.zip
file (typically in your "Downloads" folder) and Extract its Contents.Create a new folder for Terraform. A common practice on Windows is
C:\Program Files\terraform
.
Add Terraform to Your System Path (Windows Example):
To run Terraform commands from any directory in your terminal, you need to add its executable to your system’s PATH environment variable.
Click on the Start button.
Search for “environment variables” or “Edit the system environment variables” and open it.
In the System Properties window, click the “Environment Variables…” button.
Under “System variables,” find and select the “Path” variable, then click Edit…
Click New and paste the path to your Terraform folder (e.g.,
C:\Program Files\terraform
).Click OK on all open windows to close them.
Verify Terraform
Open a new terminal/command prompt and type:
terraform -v
Set Up Your Workspace: Install VS Code
A good code editor like VS Code will significantly improve your experience writing Terraform configurations with features like syntax highlighting and extensions.
Download VS Code from the official website: Visual Studio Code
With these tools installed and configured, you are now fully equipped to proceed with the Terraform lab.
Subscribe to my newsletter
Read articles from Bilal Amjad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Bilal Amjad
Bilal Amjad
Hi, I'm Bilal Amjad, a passionate DevOps enthusiast specializing in AWS, Terraform, and Kubernetes. I create beginner-friendly tutorials on my blog (bilalamjad.hashnode.dev) and YouTube channel (@bilal-amjad-dev) to share my learning journey and help others master cloud technologies. Explore my projects on GitHub (bilal-amjad-dev) and connect with me on LinkedIn for DevOps collaboration! 🚀