0
0
Terraformcloud~5 mins

Creating your first resource in Terraform - Quick Revision & Summary

Choose your learning style9 modes available
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?
Aterraform plan
Bterraform apply
Cterraform destroy
Dterraform init
What is the purpose of the resource block in Terraform?
ATo configure user permissions
BTo define infrastructure components to create
CTo store Terraform state
DTo write scripts for automation
Which command shows you what Terraform will do before making changes?
Aterraform init
Bterraform apply
Cterraform plan
Dterraform validate
What file does Terraform use to track the current state of your infrastructure?
Aterraform.tfstate
Bmain.tf
Cvariables.tf
Doutputs.tf
What happens when you run terraform apply?
ATerraform creates or updates resources as defined
BTerraform deletes all resources
CTerraform shows a plan but does not change anything
DTerraform initializes the directory
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.