Provisioning Infrastructure as Code—From Zero to Hero

Provisioning Infrastructure as Code—From Zero to Hero
Provisioning Infrastructure as Code—From Zero to Hero

CLOUD LABS



Provisioning Infrastructure as Code—From Zero to Hero

In this Cloud Lab, you’ll use IAC with AWS SAM, CloudFormation, and Terraform to create an app that interacts with AWS services.

12 Tasks

beginner

2hr

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Proficiency in deploying a serverless application using AWS SAM
Hands-on experience creating and managing AWS resources using CloudFormation templates
Hands-on experience provisioning and managing cloud resources using Terraform
Hands-on experience deploying a functional ToDo-list React application that interacts with the IAC-deployed AWS infrastructure
Hands-on experience building a serverless application with IAC using AWS DynamoDB, Lambda, and API Gateway

Technologies
Lambda logoLambda
S3 logoS3
DynamoDB logoDynamoDB
API Gateway logoAPI Gateway
Terraform logoTerraform
CloudFormation logoCloudFormation
Cloud Lab Overview

Infrastructure as Code (IaC) gives developers the power to build and deploy services using code, so they don’t have to do much manual work. To make this method work even better, developers break down big, complex architectures into smaller, more manageable pieces. They then write code to create these parts and ensure they connect smoothly with other services.

In this Cloud Lab, you’ll explore the power of Infrastructure as Code (IaC) with AWS CloudFormation, AWS SAM, and Terraform. You will construct a comprehensive infrastructure on the AWS Cloud that includes AWS DynamoDB, Lambda function, and an API Gateway. With these cloud technologies, you will use a ToDo-list React application that interacts with your IaC-deployed infrastructure.

By the end of this Cloud Lab, you’ll be able to use Infrastructure as Code and develop an understanding of its principles and practical application of AWS CloudFormation, AWS SAM, and Terraform in constructing and managing cloud-based architectures.

The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

Understand the Infrastructure as Code using tools like AWS CloudFormation and Terraform
Understand the Infrastructure as Code using tools like AWS CloudFormation and Terraform

What is Infrastructure as Code (IaC)?

Infrastructure as Code (IaC) is the practice of defining and managing infrastructure through code, rather than manual configuration. Rather than clicking through a console, you describe the desired infrastructure state in files that can be versioned, reviewed, tested, and applied consistently.

IaC is useful because it turns infrastructure into a repeatable process:

  • The same environment can be recreated in minutes.

  • Changes are tracked and auditable.

  • Teams can collaborate using pull requests and code review.

  • Rollbacks become easier because history is preserved.

Why IaC is a “from zero to hero” skill

Cloud platforms are flexible, but that flexibility creates risk. Without automation, environments drift, setups become inconsistent across teams, and small changes can cause unexpected outages.

IaC gives you control and predictability. It’s one of the fastest ways to level up from “I can deploy something” to “I can operate infrastructure responsibly.”

The core IaC workflow

Regardless of the tool, most IaC workflows share the same loop:

  1. Define: Write declarations for networks, compute, storage, security policies, and other resources.

  2. Plan: Preview what will change before anything happens. This step reduces accidental deletions and surprises.

  3. Apply: Implement changes and synchronize the real environment with the declared configuration.

  4. Manage drift: Detect when infrastructure changes outside your IaC process and decide how to reconcile them.

  5. Promote across environments: Use the same code patterns to create dev, staging, and production environments with controlled differences.

What to get right early when learning IaC

A few early habits make IaC far easier to scale:

  • State management: Understand how your tool tracks real resources.

  • Modularity: Reuse common infrastructure patterns through modules/stacks.

  • Separation of concerns: Keep foundational infrastructure separate from app-level resources when possible.

  • Secrets and credentials: Avoid hardcoding; use managed secret systems and least privilege.

  • Review and automation: Treat infra changes like code changes, PRs, reviews, and automated checks.

When IaC pays off the most

IaC is especially valuable when you:

  • Need consistent environments for multiple teams.

  • Want reliable disaster recovery and reproducibility.

  • Manage compliance and audit requirements.

  • Run multiple deployments per day through CI/CD.

  • Operate at scale where manual changes are risky.

The more production your infrastructure becomes, the less optional IaC becomes.

Cloud Lab Tasks
1.Introduction
Getting Started
2.AWS CloudFormation
Set Up a CloudFormation Template
Create a Stack
Test the Stack
Clean Up
3.AWS SAM
Set Up a SAM Template
Deploy and Test Application
Clean Up
4.Terraform
Set Up a Terraform Template
Deploy and Test Application
Clean Up
5.Conclusion
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like