Terraform HCL vocabulary

  • resource "type" "name" — declares infrastructure to create; referenced as type.name.attribute
  • data "type" "name" — reads existing infrastructure; does not create anything
  • variable — external input (overridable via tfvars, CLI, env); locals — internal computed values
  • depends_on — explicit ordering when implicit attribute references are not sufficient
  • terraform.tfvars — auto-loaded variable values; overrides defaults; keep secrets out of version control

Question 0 of 5

Read this Terraform resource block. What instance type is being provisioned?

resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t3.medium" subnet_id = var.public_subnet_id tags = { Name = "web-server" Environment = "production" } }