โ† Terraform Associate Exam Practice learning path
Terraform Associate Exam Practice ยท Module 2 of 10

Terraform basics and syntax

Blocks, resources and data sources.

๐Ÿ“– Key ideas

  1. Configuration files end in .tf; blocks include terraform, provider, resource, data, variable, output, locals and module.
  2. A resource block: resource "type" "name" { arguments }.
  3. Data sources read existing information (e.g., latest image ID) without managing it.
  4. References use type.name.attribute, such as aws_instance.web.id.
  5. Terraform builds a dependency graph from references; depends_on adds explicit dependencies.
๐Ÿ’ก Real-life example: Like a recipe card: each block lists one dish (resource) and its ingredients (arguments).
Resource blockDeclares infrastructure to manage
Data sourceReads existing information
ReferenceUsing one object's attribute in another
depends_onExplicit dependency between resources