Skip to content

About

Slides for Terraform 101 - Presentation

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Terraform 101 Learning Repository

A comprehensive learning repository for Terraform with progressive examples from basic concepts to advanced patterns.

🎯 Learning Path

This repository is organized as a progressive learning journey:

📁 Examples Structure

  1. 01-basics/ - Terraform fundamentals

    • Provider configuration
    • Basic resources
    • Variables and outputs
    • Local state management
  2. 02-variables-outputs/ - Advanced variables

    • Complex variable types (lists, maps, objects)
    • Variable validation
    • Local values and computed data
    • Advanced output formatting
  3. 03-data-sources/ - Data sources

    • Fetching existing infrastructure data
    • External data sources
    • System information queries
  4. 04-conditionals-loops/ - Control flow

    • Conditional expressions
    • Count and for_each
    • Dynamic blocks
  5. 05-modules/ - Module development

    • Creating reusable modules
    • Module composition
    • Module registry usage

🛠️ Tools & Best Practices

  • pre-commit/ - Code quality automation
    • Terraform formatting and validation
    • Security scanning with tfsec and checkov
    • Documentation generation

☁️ Cloud Provider Examples

Real-world infrastructure examples for major cloud providers:

  • aws/ - Amazon Web Services

    • VPC with public/private subnets
    • EC2 instances with security groups
    • Application Load Balancer
    • Auto Scaling configuration
  • azure/ - Microsoft Azure

    • Virtual Network and subnets
    • Virtual Machines with load balancing
    • Storage accounts and monitoring
    • Resource group management
  • gcp/ - Google Cloud Platform

    • VPC networks and firewall rules
    • Compute Engine instances
    • Cloud Storage integration
    • Managed instance groups

🔄 CI/CD Automation

  • .github/workflows/ - GitHub Actions workflows
    • terraform-validate.yml - Code validation and security scanning
    • terraform-plan.yml - Pull request planning and commenting
    • terraform-deploy.yml - Multi-cloud deployment pipeline
    • terraform-drift.yml - Infrastructure drift detection
    • See CI/CD Setup Guide for configuration

🚀 Quick Start

Prerequisites

Getting Started

  1. Clone and explore:

    git clone <repo-url>
    cd terraform-101
  2. Start with basics:

    cd 01-basics
    terraform init
    terraform plan
    terraform apply
  3. Set up pre-commit (recommended):

    cp pre-commit/.pre-commit-config.yaml .pre-commit-config.yaml
    pre-commit install

📚 Learning Resources

🎓 How to Use This Repository

  1. Follow the numbered order - Each example builds on concepts from previous ones
  2. Read the README in each directory for specific learning objectives
  3. Experiment - Modify the examples to see how changes affect behavior
  4. Use pre-commit - Learn professional development practices
  5. Check outputs - Understand how Terraform manages state and outputs

💡 Tips for Learning

  • Start small and build complexity gradually
  • Always run terraform plan before apply
  • Understand state management early
  • Practice with different variable types
  • Learn to read Terraform documentation
  • Use terraform console for testing expressions

🔧 Common Commands

# Format all Terraform files
terraform fmt -recursive

# Validate configuration
terraform validate

# Show current state
terraform show

# List resources in state
terraform state list

# Interactive console
terraform console

About

Slides for Terraform 101 - Presentation

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages