0
0
Terraformcloud~20 mins

Immutable infrastructure concept in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Immutable Infrastructure Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Immutable Infrastructure Benefits

Which of the following is the primary benefit of using immutable infrastructure?

AIt reduces configuration drift by replacing servers instead of changing them.
BIt allows quick updates by modifying existing servers directly.
CIt requires manual intervention for every update to ensure accuracy.
DIt increases downtime because servers are updated in place.
Attempts:
2 left
💡 Hint

Think about how replacing servers instead of changing them affects consistency.

Architecture
intermediate
2:00remaining
Immutable Infrastructure Deployment Pattern

In an immutable infrastructure deployment, what is the recommended approach to update an application running on cloud servers?

ADeploy a new server image with the updated application and replace old servers.
BSSH into each server and update the application manually.
CPatch the running servers with update scripts during maintenance windows.
DUse configuration management tools to change application files on live servers.
Attempts:
2 left
💡 Hint

Consider how immutable infrastructure treats servers as replaceable units.

Configuration
advanced
2:30remaining
Terraform Immutable Infrastructure Example

Given the following Terraform snippet, what will happen when you change the AMI ID and apply the configuration?

resource "aws_instance" "web" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"
  tags = {
    Name = "web-server"
  }
}
Terraform
resource "aws_instance" "web" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"
  tags = {
    Name = "web-server"
  }
}
ATerraform will update the existing instance in place with the new AMI.
BTerraform will destroy the old instance and create a new one with the new AMI.
CTerraform will ignore the AMI change and keep the old instance.
DTerraform will throw a syntax error due to missing lifecycle block.
Attempts:
2 left
💡 Hint

Think about how Terraform handles changes to immutable properties like AMI.

security
advanced
2:00remaining
Security Advantages of Immutable Infrastructure

Which security advantage is most directly improved by adopting immutable infrastructure?

AIncreased complexity in managing firewall rules.
BEasier manual auditing of server configurations.
CAbility to patch live servers quickly without downtime.
DReduced risk of unauthorized changes persisting on servers.
Attempts:
2 left
💡 Hint

Consider how replacing servers affects unauthorized changes.

service_behavior
expert
3:00remaining
Behavior of Load Balancer During Immutable Deployment

During an immutable infrastructure deployment, how should a load balancer be configured to minimize downtime when replacing backend servers?

AKeep old and new servers in the load balancer simultaneously without health checks.
BRemove old servers immediately before creating new servers to avoid conflicts.
CRemove old servers from the load balancer only after new servers pass health checks.
DManually switch traffic to new servers after all old servers are terminated.
Attempts:
2 left
💡 Hint

Think about how to keep service available during server replacement.