0
0
Terraformcloud~20 mins

Creation-time vs destruction-time in Terraform - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Creation-Destruction Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding creation-time and destruction-time in Terraform

Which statement best describes the difference between creation-time and destruction-time in Terraform?

ACreation-time refers to when resources are provisioned, and destruction-time is when resources are deleted during terraform destroy or resource replacement.
BCreation-time is when Terraform validates the configuration, and destruction-time is when Terraform applies changes.
CCreation-time is when Terraform runs the plan command, and destruction-time is when Terraform runs the apply command.
DCreation-time is when Terraform deletes resources, and destruction-time is when Terraform creates resources.
Attempts:
2 left
💡 Hint

Think about the lifecycle of a resource from start to end.

service_behavior
intermediate
1:30remaining
Behavior of resource replacement in Terraform

When a resource attribute change requires replacement, what happens during Terraform apply?

ATerraform pauses and waits for manual approval before any action.
BTerraform creates the new resource first, then destroys the old resource.
CTerraform updates the resource in place without destruction.
DTerraform destroys the old resource first, then creates the new resource.
Attempts:
2 left
💡 Hint

What is the default order of operations for resource replacement in Terraform?

Configuration
advanced
2:00remaining
Predicting output of Terraform lifecycle block with create_before_destroy

Given the following Terraform resource snippet, what is the effect during resource replacement?

resource "aws_instance" "example" {
  ami           = "ami-123456"
  instance_type = "t2.micro"

  lifecycle {
    create_before_destroy = true
  }
}
ATerraform destroys the old instance before creating the new one, causing downtime.
BTerraform updates the instance in place without replacement.
CTerraform creates the new instance before destroying the old one, ensuring no downtime.
DTerraform ignores the lifecycle block and uses default behavior.
Attempts:
2 left
💡 Hint

Check what create_before_destroy does in the lifecycle block.

security
advanced
2:00remaining
Security implications of destruction-time in Terraform

Which security risk is most relevant during destruction-time of cloud resources managed by Terraform?

ADestruction-time only affects resource billing, not security.
BSensitive data might be exposed if resource state files are not securely handled during destruction.
CTerraform prevents any data loss during destruction by default.
DResources are automatically encrypted during destruction, eliminating all risks.
Attempts:
2 left
💡 Hint

Think about what happens to resource data and state files when resources are destroyed.

Architecture
expert
2:30remaining
Designing zero-downtime infrastructure updates with Terraform

You need to update a critical database server managed by Terraform without downtime. Which approach best uses creation-time and destruction-time concepts to achieve this?

AUse lifecycle create_before_destroy to provision a new database instance before destroying the old one, then switch traffic after creation.
BDestroy the old database instance first, then create the new one to ensure clean state.
CManually delete the database outside Terraform, then run terraform apply to create a new one.
DUpdate the database instance in place without replacement, ignoring lifecycle settings.
Attempts:
2 left
💡 Hint

Consider how to avoid downtime during resource replacement.