Skip to main content

4. Input variables & validation

Declaring variables, types, defaults, sensitive, validation blocks, -var / tfvars.

⏱ ≈ 25 min this module · 📚 ≈ 5.8 h full track

🔒 Unlock this course to read the material and run the labs.

See options to unlock →
🔒 The written material unlocks with the course.
🧪 Hands-on lab Medium · 150 XP · 25min

Goal

Refactor your config so the bucket name comes from an input variable bucket_name (type string, no default), and apply with -var="bucket_name=certland-labs-var".

Requirements

  • A variable "bucket_name" block, type = string, required (no default)
  • The aws_s3_bucket uses var.bucket_name
  • Apply creates the bucket certland-labs-var

🔒 Unlock the course to run this lab.