Maghrib · Cert prep · Mon 2026-11-09 · DevOps

Lifecycle, workflows, providers, HCP Terraform, safe delivery and cluster architecture

Practice self-check. Answers stay in this page so you can grade yourself. This is not a scored exam.

Twelve scenario items on Terraform lifecycle, collaboration, providers and HCP Terraform, AWS deployment and CloudFormation, and Kubernetes cluster architecture. Companion lab: release ledger guardrails in Terraform.

Q1 · Terraform Advanced, resource lifecycle (TFA-1), import blocks
A team created an S3 bucket by hand and now wants Terraform to manage it. The adoption must show up in a normal terraform plan for review before anything is applied, and the bucket must land in state at an address the team chooses. Which approach fits?
Q2 · Terraform Advanced, resource lifecycle (TFA-1), forcing replacement
An EC2 instance managed by Terraform has become degraded, although its configuration has not changed. The team wants Terraform to destroy and recreate only that one instance, aws_instance.web, on the next run without editing any configuration. Which command does this?
Q3 · Terraform Advanced, collaborative workflows (TFA-3), dependency lock file
Developer laptops and the CI runner must install exactly the same provider versions on every terraform init, and any change to those selections must be visible in code review. What should the team do?
Q4 · Terraform Advanced, collaborative workflows (TFA-3), sharing data with remote state
Team A keeps ownership of a network configuration whose state is in an S3 backend and publishes vpc_id as a root module output. Team B must read that value in a separate configuration, using Terraform's built-in way to read another configuration's state. Which approach works?
Q5 · Terraform Advanced, providers (TFA-5), managing provider upgrades and lock hashes
Developers install providers from an internal filesystem mirror on macOS (darwin_arm64), so the committed lock file holds hashes for that platform only. A Linux (linux_amd64) CI job now fails provider verification. The team wants to keep the provider versions already selected. What should they run?
Q6 · Terraform Advanced, HCP Terraform (TFA-6), dynamic provider credentials
A team runs Terraform in HCP Terraform against AWS. Security forbids long-lived AWS access keys stored in workspace variables, and each run should authenticate with short-lived credentials. Which configuration meets this?
Q7 · Terraform Advanced, HCP Terraform (TFA-6), policy enforcement levels
An HCP Terraform policy that forbids public S3 buckets must stop a run when it fails. A designated platform team that holds the manage policy overrides permission must still be able to override a failure and let the run continue. Which Sentinel enforcement level should the policy use?
Q8 · DOP-C02 SDLC automation (1.4), deployment strategies for serverless
A team deploys a Lambda function behind an alias with AWS CodeDeploy. It wants 10 percent of traffic on the new version for 5 minutes and then the remaining 90 percent, with an automatic rollback if a CloudWatch error alarm goes into ALARM. Which setup meets this?
Q9 · DOP-C02 configuration management and IaC (2.1), CloudFormation DeletionPolicy
A CloudFormation stack contains an S3 bucket that holds audit logs. When the stack is deleted, the bucket and its objects must remain while every other resource in the stack is removed. What should the template specify?
Q10 · DOP-C02 configuration management and IaC (2.1), CloudFormation CreationPolicy
A template launches an EC2 instance whose user data installs software. The stack must not mark the instance CREATE_COMPLETE until the installation reports success, and creation must fail if no success signal arrives within 15 minutes. What should the template use?
Q11 · CKA Cluster Architecture, Installation and Configuration, highly available control plane
An administrator builds a highly available cluster with kubeadm and keeps the default stacked etcd topology. The cluster must keep working if any one control plane node fails. What is the minimum number of control plane nodes to provision?
Q12 · CKA Cluster Architecture, Installation and Configuration, RBAC
A Role named pod-reader that allows get and list on Pods already exists in the dev namespace. The qa-team group needs exactly that access in dev and nowhere else. Which object grants it?