โ Terraform Associate Exam Practice learning pathTerraform Associate Exam Practice ยท Module 2 of 10
Terraform basics and syntax
Blocks, resources and data sources.
๐ Key ideas
- Configuration files end in .tf; blocks include terraform, provider, resource, data, variable, output, locals and module.
- A resource block: resource "type" "name" { arguments }.
- Data sources read existing information (e.g., latest image ID) without managing it.
- References use type.name.attribute, such as aws_instance.web.id.
- 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