0
0
Terraformcloud~20 mins

Provider caching and mirrors in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
πŸŽ–οΈ
Provider Mirror Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Terraform Provider Mirror Usage

What is the primary benefit of configuring a provider mirror in Terraform?

AIt reduces the need to download providers repeatedly by caching them locally or on a private server.
BIt automatically updates Terraform core to the latest version.
CIt encrypts all provider binaries to enhance security during downloads.
DIt allows Terraform to run without any internet connection permanently.
Attempts:
2 left
πŸ’‘ Hint

Think about how mirrors help with repeated downloads in other software.

❓ Configuration
intermediate
2:00remaining
Configuring a Provider Mirror in Terraform

Which of the following Terraform CLI configuration snippets correctly sets a provider mirror for registry.terraform.io to a local file path /mnt/terraform-providers?

A
provider_installation {
  filesystem_mirror {
    path    = "/mnt/terraform-providers"
    include = ["registry.terraform.io/*"]
  }
  direct {
    exclude = ["registry.terraform.io/*"]
  }
}
B
provider_installation {
  mirror {
    url = "/mnt/terraform-providers"
  }
}
C
provider_installation {
  filesystem_mirror {
    path    = "/mnt/terraform-providers"
    exclude = ["registry.terraform.io/*"]
  }
  direct {}
}
D
provider_installation {
  direct {
    path    = "/mnt/terraform-providers"
    include = ["registry.terraform.io/*"]
  }
}
Attempts:
2 left
πŸ’‘ Hint

Look for the block that defines a filesystem mirror and includes the correct registry.

❓ Architecture
advanced
2:00remaining
Designing a Provider Mirror for Multiple Teams

Your company has multiple teams using Terraform. You want to set up a centralized provider mirror server to cache providers and reduce internet usage. Which architecture best supports this goal?

AConfigure each team’s Terraform to use different mirrors to avoid single points of failure.
BRequire each team to download providers directly from the public Terraform registry without caching.
CUse a cloud storage bucket without HTTP access and have teams manually copy providers from it.
DSet up a private HTTP server hosting cached provider binaries and configure all team Terraform CLI configs to use this mirror URL.
Attempts:
2 left
πŸ’‘ Hint

Think about how a shared HTTP mirror can serve multiple clients efficiently.

❓ security
advanced
2:00remaining
Security Considerations for Provider Mirrors

When using a private provider mirror server, which security practice is most important to ensure provider integrity?

AAllow anonymous access to the mirror server for convenience.
BVerify provider checksums and signatures before caching and serving them to clients.
CDisable TLS to speed up downloads from the mirror server.
DModify provider binaries to add company branding before caching.
Attempts:
2 left
πŸ’‘ Hint

Think about how to trust the providers you distribute internally.

❓ service_behavior
expert
2:00remaining
Terraform Provider Mirror Fallback Behavior

Given a Terraform CLI configured with a filesystem mirror for registry.terraform.io providers, what happens if a requested provider version is not found in the mirror?

ATerraform prompts the user to manually download and place the provider in the mirror.
BTerraform skips the provider and continues without it, causing runtime errors later.
CTerraform automatically downloads the provider directly from the public registry and caches it in the mirror path.
DTerraform fails immediately with an error stating the provider is missing in the mirror.
Attempts:
2 left
πŸ’‘ Hint

Consider how Terraform handles missing providers in mirrors to maintain smooth runs.