Recall & Review
beginner
What is a resource in Terraform?
A resource in Terraform is a component of your infrastructure, like a server or database, that Terraform manages and creates for you.
Click to reveal answer
beginner
How do you define a resource in Terraform?
You define a resource using the
resource block with a resource type and a name, for example: <br>resource "aws_instance" "example" {<br> ami = "ami-12345678"<br> instance_type = "t2.micro"<br>}Click to reveal answer
beginner
What command do you run to apply your Terraform configuration and create resources?
You run
terraform apply to create or update resources defined in your Terraform files.Click to reveal answer
beginner
Why is it important to run
terraform init before applying your configuration?terraform init downloads necessary provider plugins and prepares your working directory so Terraform can manage resources properly.Click to reveal answer
beginner
What does Terraform keep track of to know what resources it manages?
Terraform keeps a state file that records the current status of your infrastructure resources.
Click to reveal answer
Which Terraform command initializes your working directory and downloads providers?
✗ Incorrect
terraform init sets up your directory and downloads providers needed to manage resources.What is the purpose of the
resource block in Terraform?✗ Incorrect
The
resource block tells Terraform what infrastructure to create or manage.Which command shows you what Terraform will do before making changes?
✗ Incorrect
terraform plan previews changes without applying them.What file does Terraform use to track the current state of your infrastructure?
✗ Incorrect
Terraform stores state information in
terraform.tfstate.What happens when you run
terraform apply?✗ Incorrect
terraform apply makes the changes to your infrastructure.Explain the steps to create your first resource using Terraform.
Think about writing code, preparing Terraform, checking changes, then applying.
You got /4 concepts.
Describe what Terraform state is and why it matters when creating resources.
Imagine a checklist Terraform uses to remember what it created.
You got /3 concepts.