TFLAB23-Module Sources and Versioning

Module Sources and Versioning 🔧 Terraform Core ⭐ Intermediate Module Sources Terraform Registry Git Source version constraint Scenario Your team has been using a local module for S3 buckets. Now you want to try a public module from the Terraform…

TFLAB22-Writing Your First Terraform Module

Writing Your First Terraform Module 🔧 Terraform Core ⭐ Intermediate module Module Structure source Module Inputs/Outputs Scenario You’ve been copying the same S3 bucket + versioning + encryption config across 6 different projects. Every copy has slight variations and bugs.…

TFLAB21-precondition, postcondition and check Blocks

precondition, postcondition and check Blocks 🔧 Terraform Core ⭐ Intermediate precondition postcondition check block assert Custom Validation Scenario You want to catch errors at three different levels: before a resource is created (bad assumptions), after it’s created (unexpected cloud behavior),…

TFLAB18-Lifecycle Rules: Controlling Resource Behavior

Lifecycle Rules: Controlling Resource Behavior 🔧 Terraform Core ⭐ Intermediate lifecycle create_before_destroy prevent_destroy ignore_changes replace_triggered_by Scenario Your production S3 bucket must never be accidentally deleted by terraform destroy. When renaming a bucket, you want the new one created before the…