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

State, remote state, resilience and storage

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

Twelve questions. Objectives: Terraform Pro 1 and 3; DOP-C02 tasks 3.1, 3.2 and 3.3; CKA storage. Companion lab: Terraform lab 11, import and remote state.

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 and state
A teammate created the S3 bucket edge-releases-prod by hand in the console, and it now has to be managed by Terraform. No resource block exists for it yet, and you want Terraform to write the first draft of the configuration. Which approach does this?
Q2 · Terraform Pro objective 1, resource lifecycle and state
During a refactor the team renames aws_s3_bucket.releases to aws_s3_bucket.artifacts in code only. The next plan shows the old bucket being destroyed and a new one created. You want the plan to show the existing bucket moving to the new address instead. What do you add?
Q3 · Terraform Pro objective 1, resource lifecycle and state
The platform team wants Terraform to stop managing the S3 bucket aws_s3_bucket.legacy, but the bucket must keep running. The change has to go through code review and be applied by CI, so running state commands by hand is not an option. Using Terraform 1.7 or later, what is the correct change?
Q4 · Terraform Pro objective 3, collaborative workflows and remote state
Terraform state for the edge service sits in one S3 bucket and has to move to a new bucket with tighter access controls. You have edited the bucket argument in the backend block. Which command copies the existing state to the new location?
Q5 · Terraform Pro objective 3, collaborative workflows and remote state
An application configuration reads the networking configuration's state with a terraform_remote_state data source. The reference data.terraform_remote_state.network.outputs.subnet_ids fails because subnet_ids is only defined as an output inside module.vpc of the networking configuration. What is true about this data source?
Q6 · DOP-C02 task 3.1, highly available solutions
The primary edge endpoint is a public web server addressed by IP. When its health check fails, DNS should answer with a static maintenance site hosted separately, or a second-Region endpoint, and return to the primary once it is healthy again. The records live in Route 53. Which configuration meets this active-passive requirement?
Q7 · DOP-C02 task 3.1, highly available solutions
The team wants release artifacts in a bucket in us-east-1 replicated to a bucket in eu-west-1 with an S3 replication rule, and S3 will assume an IAM role to copy objects. Which condition must be true before the replication rule can be created?
Q8 · DOP-C02 task 3.3, recovery processes
A disaster recovery plan keeps the database continuously replicated to a second Region, with networking and other core infrastructure already provisioned there. The application servers in that Region are not running and are started or scaled up only during failover. Which DR strategy does this describe?
Q9 · CKA, storage
In a cluster that spans three zones, a Pod stays Pending. Its PVC bound at once and dynamically provisioned a volume in zone-a, but the scheduler picked a node in zone-b for the Pod. Which StorageClass setting prevents this by provisioning the volume only after a Pod that uses the claim is created?
Q10 · CKA, storage
A dynamically provisioned PersistentVolume backs the PVC for the release index, and its StorageClass uses the default reclaim policy. The team must delete the PVC during a migration, but the data on the volume has to survive. What should you do before deleting the PVC?
Q11 · CKA, storage
A PVC named index-data requests 10Gi from a StorageClass that sets allowVolumeExpansion: true. The service needs more room, and the data must stay in place. What is the supported way to get a larger volume?
Q12 · DOP-C02 task 3.2, scalable solutions
An EC2 Auto Scaling group runs the edge service behind an Application Load Balancer, and traffic is unpredictable. The team wants capacity to follow request load without creating or tuning CloudWatch alarms themselves. Which scaling approach fits?