Terraform samples provide concrete, copyable configurations that demonstrate how infrastructure as code is written, tested, and shared across teams. Samples cover single-cloud provisioning, multi-cloud strategies, policy enforcement, and operational automation. The reference material describes several curated collections that remain useful for learning, for bootstrapping new projects, and for transferring hard-won integration knowledge.
HashiCorp Terraform Guides
The HashiCorp Terraform Guides repository contains sample Terraform configurations, Sentinel policies, and automation scripts that can be used with Terraform Enterprise.
This directory contains sample Terraform configurations to provision VMs into AWS, Azure, and Google Cloud Platform as well as Kubernetes clusters into Azure Container Service and Google Kubernetes Engine.
This directory contains sample Terraform configurations to enable self-service infrastructure. In particular, it illustrates how developers can deploy applications to Kubernetes clusters provisioned by an operations team.
This directory contains some sample Sentinel policies for several clouds which ensure that all infrastructure provisioned with Terraform Enterprise complies with an organization's provisioning rules.
This directory provides artifacts that can be used by operations teams using Terraform Enterprise. In particular, it includes scripts that show how the Terraform Enterprise REST API can be used to automate interactions with Terraform Enterprise, set and delete variables in workspaces, and export, import, and delete Sentinel policies.
This directory provides samples of how Terraform can be used to support cloud management platforms.
If you have local Terraform configuration that you want ignored, create a new file in the directory, separate from gitignore.tf, that contains the word "gitignore" e.g. backend.gitignore.tf and it won't be picked up as a change.
The collection is structured for teams that need both developer enablement and governance. VM provisioning samples address AWS, Azure, and GCP. Kubernetes samples target Azure Container Service and Google Kubernetes Engine. Self-service samples show developers deploying to clusters provisioned by operations. Sentinel samples provide policy as code for several clouds. Automation scripts demonstrate REST API usage for workspace variable management and Sentinel policy lifecycle.
ProjectPro Terraform Project Examples
Terraform is reshaping the DevOps industry by redefining infrastructure management and enhancing the speed and efficiency of DevOps. With Terraform, you can specify infrastructure resources in human-readable configuration files that you can reuse, distribute, and modify. Terraform has more than 1700 service providers to govern thousands of different types of resources and services. This blog will cover the top 15 terraform real-time projects for practice.
The blog groups examples by expertise level. Beginner projects emphasize easy implementation. Intermediate projects assume some experience with Terraform.
Multi-Cloud Deployment using Terraform is presented as a beginner example. Using Terraform for multi-cloud deployment is a powerful strategy that enables teams to deploy resources on different cloud providers, ensuring resilience, redundancy, and cost optimization. For utilizing Terraform for multi-cloud deployment, start with defining the infrastructure to be deployed on each cloud provider using a separate configuration file for each provider.
A real-time project example involves storing images for this project in the ECR Docker image registry. Create the necessary Terraform configuration and use it to launch an ECS cluster and AWS infrastructure. After that, deploy a Django application on a group of EC2 instances controlled by an ECS Cluster. Finally, set up an HTTPS listener for an AWS load balancer and configure AWS RDS for data persistence.
Intermediate-level Terraform Projects include:
Deploy OpenStack Instances using Terraform. In this sample Terraform project, you will use Terraform to deploy two OpenStack instances, set up a web server on each one, and set each server up with a default index.html page that displays its hostname. You will first define the variables and store all the data necessary to interact with your OpenStack infrastructure. Next, specify how many instances will be deployed and give each one a proper name. Additionally, you must determine that the instance should execute a number of the commands in the bootstrapweb.sh file.
Infrastructure Monitoring and Alerting. Terraform allows its users to automate the setup of monitoring and alerting for their infrastructure. With Terraform, one can define their monitoring infrastructure as code and version control it in a source code repository.
The collection also highlights ML Model Deployment on AWS for Customer Churn Prediction with downloadable solution code, explanatory videos, and tech support. The top 15+ Terraform projects you must practice in 2023 are organized so readers can browse through examples as per their expertise with using Terraform.
State Management and Workspace Inspection
Terraform stores data about your infrastructure in its state file, which it uses to manage resources over their lifecycle.
List the resources and data sources in your Terraform workspace's state with the terraform state list command.
$ terraform state list
data.aws_ami.ubuntu
aws_instance.app_server
Even though the data source is not an actual resource, Terraform tracks it in your state file.
Print out your workspace's entire state using the terraform show command.
```
$ terraform show
data.aws_ami.ubuntu:
data "awsami" "ubuntu" {
architecture = "x8664"
arn = "arn:aws:ec2:us-west-2::image/ami-0026a04369a3093cc"
blockdevicemappings = [
{
devicename = "/dev/sda1"
ebs = {
"deleteontermination" = "true"
"encrypted" = "false"
"iops" = "0"
"throughput" = "0"
"volumesize" = "8"
"volume_type" = "gp3"
}
...
}
}
```
When you use Terraform to plan and apply changes to your workspace's infrastructure, Terraform compares the last known state in its state file, your current configuration, and data returned by your providers to create its execution plan.
Your state file can include sensitive information about your infrastructure, such as passwords or security keys, so you must store your state file securely and restrict access to only those who need to manage your infrastructure with Terraform. By default, Terraform creates your state file locally.
The state file is central to sample workflows. Samples that demonstrate inspection use terraform state list and terraform show to verify what Terraform knows about data sources like data.awsami.ubuntu and resources like awsinstance.app_server.
Futurice Terraform Examples
Lots of Terraform recipes for doing things, aimed for copy and pasting into projects.
Terraform is an ideal knowledge transfer tool that can communicate the minutea of using certain technology combinations. We use this at Futurice to disseminate hard won learnings across projects and industries, increasing the development velocity for all of our clients.
A few of the recipes have associated blog posts.
- Terraform Recipe for WordPress on Fargate
- OpenResty: a Swiss Army Proxy for Serverless; WAL, Slack, Zapier and Auth
- Low cost Friends and Family Minecraft server
- Minimalist BeyondCorp style Identity Aware Proxy for Cloud Run
- Serverless Camunda Business Workflow Engine on Cloud Run
- A Detailed Look at Camunda BPMN Application Development
- Exporting Bigquery to Cloud Memorystore
External contributions welcome! All that we ask is that the recipe is interesting, and that it worked at some point. There is no expectation of maintenance. Maintained projects should probably have their own repository.
Recipes demonstrate practical patterns such as serving content from a bucket with automatic HTTPS redirection. After terraform apply, which may take a very long time, you should be able to visit hello.example.com, be redirected to HTTPS, and be greeted by the above Hello World! message.
You may, and probably will, want to upload more files into the bucket outside of Terraform.
The value expression for the site module is shown as:
value = "${module.my_site.bucket_name}"
The collection emphasizes copy-paste readiness and knowledge transfer across technology combinations.
Azure Storage Samples
The TAMU Cloud sample set includes Azure configurations for storage containers and storage tables.
Finally, run terraform apply s3.plan to apply those exact changes after approval.
Create Storage Container
terraform {
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.0"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "US"
}
resource "azurerm_storage_account" "example" {
name = "example-storrage"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "example"
}
}
resource "azurerm_storage_container" "example" {
name = "example-name"
storage_account_name = azurerm_storage_account.example.name
container_access_type = "private"
}
Create Azure Storage Table
terraform {
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.0"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "US"
}
resource "azurerm_storage_account" "example" {
name = "example-storrage"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "example"
}
}
resource "azurerm_storage_table" "example" {
name = "mysampletable"
storage_account_name =
The Azure samples illustrate provider pinning with required_version >=0.12 and azurerm version ~>2.0, resource group creation in location US, storage account with Standard tier and LRS replication, and private container access.
Sample Repository Comparison
| Repository | Focus | Cloud Targets | Key Artifacts |
| HashiCorp Terraform Guides | Enterprise automation, policy, self-service | AWS, Azure, GCP, ACS, GKE | VM configs, K8s configs, Sentinel policies, REST API scripts |
| ProjectPro Examples | Learning projects by skill level | AWS, OpenStack, multi-cloud | ECS + ECR + Django + RDS, OpenStack web servers, monitoring |
| Futurice Terraform Examples | Copy-paste recipes | AWS, GCP | WordPress on Fargate, Cloud Run services, BigQuery export |
| TAMU Cloud TF Example | Azure storage patterns | Azure | Storage container, storage table |
How Samples Are Used in Practice
Samples accelerate onboarding by providing working configuration skeletons. The HashiCorp guides show how operations teams can combine provisioning samples with Sentinel policies to enforce compliance while allowing developer self-service. ProjectPro examples demonstrate end-to-end application stacks such as ECS clusters with ECR image registries, load balancer HTTPS listeners, and RDS persistence. Intermediate OpenStack examples teach variable definition, instance count specification, naming, and bootstrap script execution.
State inspection samples reinforce safe operations. Because state files can contain passwords or security keys, samples emphasize secure storage and restricted access. Default local state creation is highlighted as a starting point that teams typically migrate to remote backends.
Recipes from Futurice are designed for knowledge transfer. They communicate minute details of technology combinations and are intended to be copied into projects. The collection accepts external contributions with no maintenance expectation, encouraging sharing of proven patterns.
Conclusion
Terraform samples remain a core mechanism for scaling infrastructure as code adoption. The HashiCorp Terraform Guides provide enterprise-grade configurations for multi-cloud VM and Kubernetes provisioning, self-service enablement, Sentinel policy enforcement, and Terraform Enterprise API automation, with a convention for ignoring local backend files via gitignore-named files. ProjectPro’s curated examples span beginner multi-cloud deployment strategies to intermediate OpenStack instance bootstrapping and monitoring as code, plus a concrete AWS stack with ECR, ECS, EC2, load balancer HTTPS, and RDS. Futurice’s recipe collection supplies copy-paste patterns for serverless and cloud-native architectures and emphasizes knowledge transfer across teams. Azure storage samples demonstrate provider constraints, resource group and storage account definitions, and container and table resources. State management samples underscore the importance of inspecting state with terraform state list and terraform show, and protecting sensitive data stored in state files. Together these collections illustrate how samples support learning, rapid prototyping, governance, and operational automation without requiring bespoke design from scratch.