Cert prep · Terraform Authoring and Operations Pro · AWS DevOps Engineer Pro (DOP-C02) · CKA

State, locking, provider aliases, HCP Terraform, rollbacks and kubeadm upgrades

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

Ten questions. Objectives: Terraform Pro 1, 3, 5 and 6; DOP-C02 tasks 1.4 and 2.1; CKA cluster architecture. Companion lab: Terraform lab 10, edge provider aliases.

Lab download. Starter is the tree you edit. Worked answer is a separate file; open it after the starter passes. Terraform exactly 1.10.5 and one download of hashicorp/aws 6.71.0. Mock provider: no credentials and no cloud spend. All lab requirements.

Q1 · Terraform Pro objective 1, resource lifecycle
During an incident, an engineer edited an ingress rule on the aws_security_group.edge group in the AWS console. The team wants Terraform's state to record the real remote settings without changing any infrastructure. Which approach does that?
Q2 · Terraform Pro objective 3, collaborative workflows
A team keeps Terraform state in an S3 bucket and runs Terraform 1.11 or later. No DynamoDB table exists, and two engineers sometimes run terraform apply at the same moment. They want the second run to be blocked instead of risking corrupted state. What should they do?
Q3 · Terraform Pro objective 3, collaborative workflows
A configuration declares the aws provider with version = "~> 6.71". The committed .terraform.lock.hcl records version 6.74.0. Since then, 6.80.0 and 7.1.0 have been published. A teammate clones the repository and runs terraform init with no extra flags. Which version do they get?
Q4 · Terraform Pro objective 5, providers
A root module manages the primary release bucket in us-east-1 through the default aws provider. The replica bucket must live in us-west-2, and its settings are packaged in a child module ./modules/replica that uses a single aws provider. How should the root module wire this up?
Q5 · Terraform Pro objective 5, providers
A team runs Terraform for the aws provider both locally and from CI. Policy says the deployer IAM role edge-deployer must be used and that static access keys must not live in the configuration. Which setup meets this?
Q6 · Terraform Pro objective 6, HCP Terraform
A team has an HCP Terraform workspace connected to a GitHub repository, tracking the main branch. An engineer opens a pull request that changes the bucket lifecycle rules. What does HCP Terraform do for that pull request?
Q7 · Terraform Pro objective 6, HCP Terraform
An IAM OIDC identity provider for HCP Terraform and an IAM role that trusts it already exist in the AWS account. The team wants every run of a workspace to receive short-lived AWS credentials instead of stored access keys. What should they configure on the workspace?
Q8 · DOP-C02 task 1.4, deployment strategies
A Lambda function is deployed through an alias with AWS CodeDeploy using CodeDeployDefault.LambdaCanary10Percent5Minutes. The team wants the new version rolled back automatically if the error rate rises while the canary traffic is flowing. What should they configure?
Q9 · DOP-C02 task 2.1, reusable IaC
A platform team must deploy one baseline stack, an audit IAM role and a log bucket, to every account in the Workloads OU across three Regions. Accounts created in that OU later must receive the stack without anyone running a command. The team uses AWS Organizations and does not want to create IAM roles in each account by hand. What should they do?
Q10 · CKA, cluster architecture
A kubeadm cluster has three control plane nodes behind a load balancer plus several worker nodes. The administrator must move the cluster to the next minor Kubernetes version. Which sequence matches the documented procedure for the control plane?