Recall & Review
beginner
What is a resource block in Terraform?
A resource block defines a piece of infrastructure to create or manage, like a server or database. It tells Terraform what to build and how.
Click to reveal answer
beginner
What are the four main parts of a Terraform resource block?
1. The keyword
resource<br>2. The resource type (like aws_instance)<br>3. The resource name (a unique label you choose)<br>4. The configuration inside curly braces defining propertiesClick to reveal answer
beginner
Example:
resource "aws_instance" "web" {<br> ami = "ami-123456"<br> instance_type = "t2.micro"<br>} What does this block do?It tells Terraform to create an AWS server named "web" using the AMI with ID "ami-123456" and the instance type "t2.micro".
Click to reveal answer
beginner
Can you have multiple resource blocks of the same type in one Terraform file?
Yes! Each resource block must have a unique name within its type, so you can create many resources of the same type by giving each a different name.
Click to reveal answer
beginner
Why is it important to use meaningful names in resource blocks?
Meaningful names help you and others understand what each resource is for, making your infrastructure easier to manage and avoid confusion.
Click to reveal answer
What keyword starts a resource block in Terraform?
✗ Incorrect
The keyword
resource is used to define a resource block.In
resource "aws_s3_bucket" "mybucket" {}, what is "mybucket"?✗ Incorrect
"mybucket" is the resource name, a unique label you assign.
Which part of a resource block defines the cloud service or infrastructure type?
✗ Incorrect
The resource type specifies what kind of infrastructure to create, like an AWS instance or S3 bucket.
Can two resource blocks have the same resource name in the same Terraform file?
✗ Incorrect
Resource names must be unique within the same resource type, so two blocks can have the same name only if they are different types.
What symbol encloses the configuration settings inside a resource block?
✗ Incorrect
Curly braces {} enclose the configuration inside a resource block.
Describe the structure of a Terraform resource block and its main components.
Think about how you tell Terraform what to create and how.
You got /4 concepts.
Explain why unique and meaningful resource names are important in Terraform configurations.
Imagine managing many servers with confusing labels.
You got /3 concepts.