- A
terraform apply --resource=google_sql_database_instance.main
Why wrong: `--resource` is not a valid Terraform flag. Use `-target` to target specific resources.
- B
terraform apply -target=google_sql_database_instance.main
The `-target` flag limits apply to the specified resource and its direct dependencies — creating only the Cloud SQL instance from the 15-resource plan.
- C
terraform apply -only=google_sql_database_instance.main
Why wrong: `-only` is not a valid Terraform flag. Targeted applies use `-target`.
- D
terraform plan --filter=google_sql_database_instance.main && terraform apply
Why wrong: `--filter` is not a valid Terraform plan flag. Running `terraform apply` after an unfiltered plan would apply all changes.
Terraform Apply a Specific Resource with -target
This ACE practice question tests your understanding of a team uses terraform to manage gcp infrastructure. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A team uses Terraform to manage GCP infrastructure. After running `terraform plan`, they see 15 resources to be created. They want to apply only the Cloud SQL instance (resource name: `google_sql_database_instance.main`) without applying all 15 changes. Which Terraform command targets a specific resource?
Quick Answer
The answer is `terraform apply -target=google_sql_database_instance.main`. This is correct because Terraform’s `-target` flag allows you to scope an operation to a specific resource address, instructing Terraform to apply only that resource and its dependencies while ignoring all other changes in the plan. On the Google Associate Cloud Engineer exam, this concept tests your understanding of Terraform’s execution granularity and safe partial deployments—a common trap is assuming you can use `-target` with a resource name alone, but the correct syntax requires the full resource address (type.name). A helpful memory tip is to think of `-target` as a laser pointer: it focuses Terraform’s action on exactly one resource, leaving the rest of the infrastructure untouched.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
terraform apply -target=google_sql_database_instance.main
Option B is correct because Terraform uses the `-target` flag to limit the operation to a specific resource address, allowing you to apply only the `google_sql_database_instance.main` resource without affecting the other 14 resources in the plan. This is the standard Terraform syntax for targeting a single resource during `apply` or `destroy` operations.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
terraform apply --resource=google_sql_database_instance.main
Why it's wrong here
`--resource` is not a valid Terraform flag. Use `-target` to target specific resources.
- ✓
terraform apply -target=google_sql_database_instance.main
Why this is correct
The `-target` flag limits apply to the specified resource and its direct dependencies — creating only the Cloud SQL instance from the 15-resource plan.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
terraform apply -only=google_sql_database_instance.main
Why it's wrong here
`-only` is not a valid Terraform flag. Targeted applies use `-target`.
- ✗
terraform plan --filter=google_sql_database_instance.main && terraform apply
Why it's wrong here
`--filter` is not a valid Terraform plan flag. Running `terraform apply` after an unfiltered plan would apply all changes.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the distinction between valid Terraform flags like `-target` and common but invalid flags such as `--resource`, `-only`, or `--filter`, exploiting candidates' familiarity with other tools (e.g., `kubectl` or `gcloud`) that use similar but different syntax.
Detailed technical explanation
How to think about this question
The `-target` flag in Terraform uses resource address syntax (e.g., `google_sql_database_instance.main`) and can also target modules or resources within modules using addresses like `module.foo.google_sql_database_instance.main`. Under the hood, Terraform builds a dependency graph and applies only the targeted resource and its dependencies, which can cause unintended side effects if dependencies are not fully understood, such as creating a dependent resource that was not intended to be created.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Related practice questions
Related ACE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Configuring Access and Security practice questions
Practise ACE questions linked to Configuring Access and Security.
Planning and Configuring a Cloud Solution practice questions
Practise ACE questions linked to Planning and Configuring a Cloud Solution.
Ensuring Successful Operation of a Cloud Solution practice questions
Practise ACE questions linked to Ensuring Successful Operation of a Cloud Solution.
Deploying and Implementing a Cloud Solution practice questions
Practise ACE questions linked to Deploying and Implementing a Cloud Solution.
Setting Up a Cloud Solution Environment practice questions
Practise ACE questions linked to Setting Up a Cloud Solution Environment.
ACE fundamentals practice questions
Practise ACE questions linked to ACE fundamentals.
ACE scenario practice questions
Practise ACE questions linked to ACE scenario.
ACE troubleshooting practice questions
Practise ACE questions linked to ACE troubleshooting.
Practice this exam
Start a free ACE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this ACE question test?
Read the scenario before looking for a memorised answer.
What is the correct answer to this question?
The correct answer is: terraform apply -target=google_sql_database_instance.main — Option B is correct because Terraform uses the `-target` flag to limit the operation to a specific resource address, allowing you to apply only the `google_sql_database_instance.main` resource without affecting the other 14 resources in the plan. This is the standard Terraform syntax for targeting a single resource during `apply` or `destroy` operations.
What should I do if I get this ACE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Keep practising
More ACE practice questions
- A team's Cloud Build pipeline must: (1) run unit tests, (2) build a Docker image only if tests pass, (3) push the image…
- A team needs a database backup job to run every day at 2 AM UTC. The job calls an HTTP endpoint to trigger the backup. T…
- A team wants to receive an email alert when the average CPU utilization of VMs in a managed instance group exceeds 80% f…
- A Go service is consuming significantly more CPU than expected. The team suspects an inefficient function but doesn't kn…
- A network team is creating a new VPC and must decide between auto mode and custom mode. Why would they choose custom mod…
- A company organizes its GCP projects by business unit — Finance, Engineering, and Sales. Which resource is best suited t…
Last reviewed: Jun 30, 2026
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.