Introduction to Infrastructure as Code with Terraform on AWS
Write your first HCL configuration and deploy a DynamoDB table to AWS using Terraform's init, plan, and apply workflow.

Lab overview
Infrastructure as Code (IaC) allows engineers to define and manage cloud resources through configuration files rather than manual console operations. This approach brings the same version control, peer review, and repeatability that software development teams rely on to infrastructure management. Terraform, developed by HashiCorp, is one of the most widely adopted IaC tools. It uses a declarative model where you describe the desired end state of your infrastructure, and Terraform determines the steps needed to reach that state. Its provider-based architecture supports AWS, Azure, GCP, and hundreds of other platforms through a single consistent workflow.
In this lab, you will write your first Terraform configuration in HashiCorp Configuration Language (HCL) to define a DynamoDB table on AWS and deploy it using Terraform's core workflow — init, plan, and apply.
Objectives
Upon completing this beginner level lab, you will be able to:
- Write a Terraform configuration file in HCL to define an AWS resource
- Initialize a Terraform project and download provider plugins using terraform init
- Preview infrastructure changes using terraform plan and deploy them using terraform apply
- Inspect the Terraform state file to understand how Terraform tracks managed resources
Who is this lab for?
This lab is designed for:
- Cloud beginners who want their first hands-on experience with Infrastructure as Code
- Aspiring DevOps engineers looking to learn Terraform fundamentals for AWS
- Terraform Associate candidates preparing for the certification exam
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.
More labs like this
Import Existing Infrastructure into Terraform State Management
Use Terraform import blocks and the legacy import command to bring pre-existing Azure resources under Terraform state management.
Terraform Custom Validation and Check Blocks on AWS
Write variable validation rules, add preconditions and postconditions to resources, attach output preconditions, and create check blocks on AWS.
Challenge - Import and Refactor Existing Infrastructure with Terraform
Bring pre-existing Azure resources under Terraform management without recreating them, reconcile your configuration to a zero-change plan, then refactor the storage account into a reusable module.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Logging into the AWS CLI
- 02
Write Your First Terraform Configuration File for AWS
1 automated check
- 03
Deploy a DynamoDB Table with Terraform Init Plan and Apply
1 automated check
Skills validated
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.