0
0
Terraformcloud~30 mins

Terraform vs CloudFormation vs Pulumi - Hands-On Comparison

Choose your learning style9 modes available
Terraform vs CloudFormation vs Pulumi
📖 Scenario: You are working as a cloud engineer for a small company. Your team wants to manage cloud resources using Infrastructure as Code (IaC). You want to understand how to create a simple cloud resource using three popular IaC tools: Terraform, CloudFormation, and Pulumi.This project will guide you step-by-step to create a basic cloud infrastructure resource using Terraform, then add configuration, apply core logic, and finalize the setup. This will help you see how Terraform works compared to CloudFormation and Pulumi.
🎯 Goal: Build a simple Terraform configuration that creates an AWS S3 bucket with a specific name and versioning enabled. This will help you understand the basics of Terraform syntax and resource management.
📋 What You'll Learn
Create a Terraform configuration file named main.tf.
Define an AWS provider with a specific region.
Create an S3 bucket resource with a given name.
Enable versioning on the S3 bucket.
💡 Why This Matters
🌍 Real World
Cloud engineers use Infrastructure as Code tools like Terraform to automate and manage cloud resources reliably and repeatedly.
💼 Career
Knowing Terraform basics is essential for cloud jobs that require managing AWS, Azure, or Google Cloud infrastructure efficiently.
Progress0 / 4 steps
1
DATA SETUP: Define the AWS provider
Create a Terraform configuration file main.tf and add a provider block for AWS with the region set to us-east-1.
Terraform
Need a hint?

The provider block tells Terraform which cloud to connect to and which region to use.

2
CONFIGURATION: Add an S3 bucket resource with a name
In main.tf, add a resource block to create an AWS S3 bucket named my-unique-bucket-12345.
Terraform
Need a hint?

The resource block defines the cloud resource you want to create. Use aws_s3_bucket as the resource type.

3
CORE LOGIC: Enable versioning on the S3 bucket
Add an aws_s3_bucket_versioning resource named my_bucket_versioning. Set the bucket to aws_s3_bucket.my_bucket.id and add a versioning_configuration block with status set to Enabled.
Terraform
Need a hint?

Versioning helps keep multiple versions of objects in the bucket. In modern Terraform AWS provider, use the dedicated aws_s3_bucket_versioning resource with status = "Enabled".

4
COMPLETION: Add a tag to the S3 bucket
Add a tags block inside the aws_s3_bucket resource with a tag Environment set to Dev.
Terraform
Need a hint?

Tags help organize and identify resources. Add the tags block with the key and value inside the resource.