0
0
Terraformcloud~20 mins

What is Infrastructure as Code in Terraform - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
IaC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does Infrastructure as Code (IaC) primarily enable?

Infrastructure as Code (IaC) is a key practice in cloud computing. What is the main benefit it provides?

AIt allows managing infrastructure using code to automate setup and changes.
BIt requires writing code only for application logic, not infrastructure.
CIt replaces all physical servers with virtual machines manually.
DIt is a tool for monitoring network traffic in real time.
Attempts:
2 left
💡 Hint

Think about how code can help with infrastructure tasks.

Architecture
intermediate
2:00remaining
Which Terraform file defines the desired infrastructure state?

In Terraform, which file typically contains the code that describes the infrastructure you want to create?

Avariables.tf
Bmain.tf
Coutputs.tf
Dterraform.tfstate
Attempts:
2 left
💡 Hint

Look for the file where resources are declared.

service_behavior
advanced
2:00remaining
What happens when you run 'terraform apply' with changed code?

You have updated your Terraform code to add a new server. What does terraform apply do?

AIt ignores the changes and keeps the infrastructure as before.
BIt deletes all existing servers and creates only the new one.
CIt only shows the changes but does not apply them.
DIt creates the new server and updates the infrastructure to match the code.
Attempts:
2 left
💡 Hint

Think about how Terraform syncs real infrastructure with code.

security
advanced
2:00remaining
Which practice improves security when using Infrastructure as Code?

When managing infrastructure with code, which practice helps keep secrets safe?

AShare code files with secrets openly to all team members.
BWrite all passwords directly in the Terraform files for easy access.
CStore secrets in environment variables or secret managers, not in code files.
DUse plain text files in the repository to store sensitive data.
Attempts:
2 left
💡 Hint

Think about how to keep passwords and keys safe.

Best Practice
expert
2:00remaining
What is a key benefit of using version control with Infrastructure as Code?

Why should you store your Infrastructure as Code files in a version control system like Git?

AIt tracks changes over time and allows safe collaboration and rollback.
BIt automatically applies infrastructure changes without review.
CIt prevents any changes to infrastructure code once committed.
DIt encrypts the infrastructure code to hide it from users.
Attempts:
2 left
💡 Hint

Think about teamwork and history of changes.