Hour 8: Optional: 50 troubleshooting cases and 50 interview questions
Hour 8 (optional): 50 troubleshooting cases and 50 interview questions
The first seven hours build a landing zone. This optional hour tests whether you can run it and explain it. It is a case book and an interview kit in one: 50 production troubleshooting cases and 50 interview questions with model answers, split across eight modules. Nothing in this hour introduces a new service. Every case and every answer reuses what you built in hours 1 to 7: the hierarchy, IAM, Organization Policy, the network hub, hybrid connectivity, logging and cost, and Terraform.
Modules 1 to 4 are the troubleshooting cases. Each case has the same five parts: the symptom you see, the cause, read-only diagnosis commands, the fix, and the prevention step that belongs in the landing zone. Cases are grouped by the layer that fails: identity and organization (Cases 1 to 13), network (Cases 14 to 26), logging, cost and infrastructure as code (Cases 27 to 38), and security, policy and compute (Cases 39 to 50). The other tabs of each module explain the case patterns, the triage method and the commands that find the cause.
Modules 5 to 8 are the interview questions: landing-zone design, identity, networking and security, operations, logging, cost and IaC, and finally scenario and behavioural questions with a mock-interview routine. Each question has a model answer that you can say aloud in about two minutes, and the commands an interviewer expects you to know.
The module pages keep the usual ten tabs. In the interview modules the Troubleshooting tab is relabelled as the Interview questions tab, so the content sits where you expect to find it.
What you will be able to do after this hour
- Apply one triage order (identity, scope, access, policy, API and billing, audit log) to any failure in the landing zone.
- Recognise 50 recurring production problems from their symptom text and name the first command that confirms the cause.
- Fix each problem without weakening the guardrail, and state the prevention that stops it from returning.
- Tell an Organization Policy denial from an IAM denial, a deny policy, a VPC Service Controls violation and a disabled API.
- Answer 50 interview questions on design, identity, network, security, operations, cost and IaC with a short, structured answer.
- Run a mock interview with a timer, a scoring sheet and a list of follow-up questions.
Schedule (60 minutes)
The minutes are the reading and listening time of each module. The case book is meant to be revisited: use the case index at the top of each Troubleshooting tab as a lookup during real incidents, and use the labs to reproduce selected cases in a sandbox.
Who should take it
- Engineers who completed hours 1 to 7 and want to practise operating the landing zone under pressure.
- Platform and on-call engineers who need a shared runbook of first checks.
- Candidates preparing for a cloud platform, cloud architect or SRE interview on Google Cloud.
If you have not done hours 1 to 7, the cases will still read, but many fixes refer to objects built there (Shared VPC, firewall policies, sinks, the project factory, state buckets).
What you need
- The sandbox from the earlier hours: a sandbox organization or folder, a sandbox project, and a billing account with a budget.
- The Google Cloud CLI (
gcloud) or Cloud Shell, and optionally Terraform 1.x for the IaC cases. - A notebook or document where you write your own answers. Interview practice works only if you say or write the answer yourself.
See the Setup tab for how to use the case book safely in a sandbox.
PROJECT_ID and ORG_ID must be replaced with your own values, and the IDs in expected output are illustrative.Setup
Environment for Hour 8
This hour is a case book. You can read all of it with no setup, but it is much more useful if you can reproduce a few cases in a sandbox and run the diagnosis commands against real objects. This page says what you can reproduce, what you must never run in production, and how to keep the budget and the cleanup under control.
1. What you need
| Item | Why | Minimum |
|---|---|---|
| Sandbox organization or sandbox folder | Cases on Organization Policy, deny policies and hierarchy need folders | A folder where you hold project creator and policy admin roles |
| Sandbox project with billing | Network, logging and compute labs | One project linked to a sandbox billing account |
| Budget on the billing account | Early warning for lab cost | A budget with 50, 90 and 100 percent alerts to your email |
| gcloud CLI or Cloud Shell | All diagnosis commands | Current release channel |
| Terraform (optional) | IaC cases 35 to 38 | Terraform 1.x with the Google provider (pin the major version in required_providers) |
2. Check your environment
Run these read-only commands first. They are free. IDs in the expected output are illustrative.
gcloud --version gcloud auth list gcloud config list gcloud organizations list gcloud projects describe PROJECT_ID --format="value(projectId,parent.id,lifecycleState)" gcloud billing projects describe PROJECT_ID gcloud services list --enabled --project=PROJECT_ID --format="value(config.name)"
Google Cloud SDK (current release) ACTIVE ACCOUNT * you@example.com DISPLAY_NAME ID DIRECTORY_CUSTOMER_ID example.com 123456789012 C01abc2de PROJECT_ID 987654321098 ACTIVE billingAccountName: billingAccounts/0X0X0X-0X0X0X-0X0X0X billingEnabled: true projectId: PROJECT_ID
If gcloud organizations list returns nothing, you have no organization. You can still read every case, and reproduce the cases that need only a project (for example Cases 10, 14, 20, 21, 27 and 36). Cases that need folders or Organization Policy are reading exercises in that environment.
3. What can be reproduced in a sandbox
| Case group | Safe to reproduce | How |
|---|---|---|
| Cases 7, 8, 10 | Yes | Grant a role to the wrong principal type, disable and enable an API in a sandbox project |
| Cases 14, 20, 21, 22 | Yes, low cost | Custom-mode VPC, one small VM without an external IP, Cloud NAT, IAP firewall rule; delete in reverse order |
| Cases 16, 17, 18 | Yes | Private DNS zone with and without the network attached, firewall priorities in a lab VPC |
| Cases 27, 28, 29 | Yes, low cost | A sink to a lab log bucket, writer identity permission, an exclusion on a lab log name |
| Cases 35, 36, 38 | Yes | Terraform with a lab state bucket, a disabled API, a manual label change |
| Cases 39, 44, 46, 47 | Yes, in a sandbox folder | Set a constraint on the sandbox folder, try to create the denied resource, then remove the policy |
| Case 41 | Only with a lab key | Disable and re-enable a version of a lab key; never touch a key that protects data |
| Cases 25, 26, 40 | Read the commands; reproduce only with a lab design | HA VPN and perimeters need a peer or a perimeter policy; use dry-run and a sandbox folder |
4. What must not be run in production
terraform force-unlock without confirming that no run is active (Case 35), removing firewall rules, routes, NAT or VPN objects (Cases 14 to 26), adding log exclusions or changing audit configurations (Cases 27 to 30), and changing billing links or budgets (Cases 2, 4, 33).- In production, run only the read-only diagnosis commands and attach their output to the incident ticket.
- Make every fix through a pull request or a change ticket, with a second reviewer and a rollback step.
- Prefer the audit log and Policy Troubleshooter over changing anything "to see if it helps".
- Do not paste secrets, key material or tokens into tickets, chat or the course notes.
5. Budget and cleanup rules
- Budget first. Create a budget before any lab that creates a billable resource. Budgets send alerts and do not cap spend: the alert can arrive after the cost has occurred.
- One lab, one label. Label lab resources with
lab=h8and an owner label so you can find them withgcloud asset search-all-resourcesor the console. - Keep labs short. Run a lab in one sitting and delete resources in the same sitting. Use the smallest machine type, one region and no external IP.
- Delete in reverse order of creation. Instances, then NAT, routers, firewall rules, subnets, networks. Sinks and buckets before the project. Policies on the sandbox folder last, restoring the inherited state.
- Verify the cleanup. List instances, routers, sinks and buckets afterwards, and look at the billing report the next day.
- Do not use real data. Labs use empty resources and test entries only.
Cost classes used in this hour: free for metadata-only operations and reads; low (usually well under a few USD per day for the lab) for a small VM, a NAT gateway, a log bucket or a key; anything else is stated in the lab and needs your explicit decision.
6. If something goes wrong
- Stop creating resources. Run the read-only checks from Module 1 (identity, scope, access, policy, API and billing).
- List what the lab created by label and delete it.
- If a policy on the sandbox folder blocks you, delete that folder policy with the same identity that created it, or ask the sandbox administrator.
- If you lose access to a project, use the break-glass process of your sandbox, not a new owner role from a personal account.
Module 1 · Identity and organization cases
- Apply a fixed triage order (identity, scope, policy, API, audit log) to identity and organization failures.
- Diagnose 13 recurring production cases with read-only gcloud commands before changing anything.
- Prevent each case with a guardrail, a Terraform default or a monitoring rule.
The short answer
Identity and organization failures are mostly scope, principal or policy mistakes, not product bugs. A project is created in the wrong place, a role is granted at the wrong level, a group is added as a user, an API is not enabled, or a guardrail blocks a request that was valid yesterday. This module gives you 13 recurring cases (Case 1 to Case 13) and a triage method that works for all of them.
What: the case-book format
Every case in the Troubleshooting tab has the same five parts so you can scan them during an incident.
- Symptom: the exact message or behaviour the user reports.
- Cause: the mechanism that produces it.
- Diagnosis: read-only commands that confirm the cause.
- Fix: the smallest change that removes the cause.
- Prevention: the guardrail, default or alert that stops it from returning.
Why: most incidents repeat
After a landing zone is live, the same families of failures appear in every company: creation denied, billing not linked, default resources created, quotas, accidental deletion, IAM mistakes and federation misconfiguration. A written case book shortens the time to the first correct check from hours to minutes, and it makes the on-call rotation less dependent on one expert.
How it works: the triage order
| Step | Question | Typical evidence |
|---|---|---|
| 1. Identity | Who is really calling? | gcloud auth list, the principal in the audit log |
| 2. Scope | Which organization, folder or project and which resource? | gcloud projects describe, the resource name in the error |
| 3. Access | Does an allow binding exist, and is there a deny? | get-iam-policy, gcloud iam policies list, Policy Troubleshooter |
| 4. Policy | Does an Organization Policy block the request? | gcloud org-policies describe --effective |
| 5. API and billing | Is the service enabled and is billing linked? | gcloud services list --enabled, gcloud billing projects describe |
| 6. Audit log | What exactly was denied, by whom, when? | gcloud logging read on the audit log |
When to use the case book
Use it in three situations: during an incident (find the matching symptom), during design review (turn each prevention line into a guardrail), and during onboarding (a new engineer reproduces two cases in a sandbox).
What it is confused with
| Looks like | But it is | How to tell |
|---|---|---|
| Permission denied | An Organization Policy violation | The message names a constraints/... value, not a permission |
| Permission denied | An API that is not enabled | The error says SERVICE_DISABLED and gives an activation URL |
| Permission denied | A deny policy | The role is present, but Policy Troubleshooter shows a deny rule |
| Quota exceeded | A billing or limit problem | The message names a quota metric or a billing account limit |
| Project not found | A deleted or pending-deletion project | lifecycleState is DELETE_REQUESTED |
Three common misunderstandings
- "Grant Owner and move on." It hides the cause, breaks least privilege, and often does not help, because a deny policy or an Organization Policy still applies.
- "The error names the project, so the project is the scope." The denied resource may be a folder, a billing account, a subnet or a service account in another project.
- "IAM changes are instant." They are eventually consistent. Check the binding, then retry for a few minutes before you escalate.
Figure 1. The triage order and the cases it finds. Work left to right and stop at the first step that explains the error.
Figure 2. The first fork. Error text with a constraint name or SERVICE_DISABLED goes to policy and API checks; everything else goes to IAM.
The animation follows a denied project creation (Case 1) from the engineer's command to the audit log entry. Watch where the permission is checked and how the denial is recorded, because the same record is the starting point for most cases in this module.
These are the read-only commands you will use in almost every case. Run them in Cloud Shell or a shell where gcloud is authenticated. Write commands are marked and say whether they cost money.
gcloud projects get-iam-policy
Purpose. Shows the bindings on a project, so you can see which principal holds which role.
gcloud projects get-iam-policy PROJECT_ID \ --flatten="bindings[].members" \ --filter="bindings.members:GROUP_EMAIL" \ --format="table(bindings.role,bindings.members)"
Flags. --flatten turns each member into its own row, --filter keeps only one principal, --format chooses the columns. Use group:GROUP_EMAIL or user:EMAIL in the filter when the match is ambiguous.
ROLE MEMBERS roles/compute.networkViewer group:platform-ops@example.com
Common errors. An empty table means no binding for that principal on this project. It may still inherit access from a folder or the organization. This command is read-only and free.
gcloud policy-troubleshoot iam
Purpose. Asks IAM why a principal can or cannot use a permission on a resource. It explains allow, deny and condition results.
gcloud policy-troubleshoot iam \ //cloudresourcemanager.googleapis.com/projects/PROJECT_ID \ --principal-email=USER_EMAIL \ --permission=resourcemanager.projects.get
access: GRANTED explainedPolicies: - access: GRANTED fullResourceName: //cloudresourcemanager.googleapis.com/projects/PROJECT_ID policy: ...
Flags. The first argument is the full resource name, then the principal and the permission. Check gcloud policy-troubleshoot iam --help for the flags in your SDK version. The caller needs permission to run the troubleshooter. Free.
gcloud org-policies describe --effective
Purpose. Shows the effective Organization Policy for a constraint at a project, after inheritance and merging.
gcloud org-policies describe compute.skipDefaultNetworkCreation \ --project=PROJECT_ID --effective
name: projects/PROJECT_ID/policies/compute.skipDefaultNetworkCreation spec: rules: - enforce: true
Common errors. NOT_FOUND for the effective policy means the constraint is not set anywhere above the project and the default behaviour applies. Free.
gcloud services list --enabled
Purpose. Lists enabled APIs in a project. A missing API is the cause of every SERVICE_DISABLED error.
gcloud services list --enabled --project=PROJECT_ID --filter="config.name:compute.googleapis.com"
NAME TITLE compute.googleapis.com Compute Engine API
Cost. Listing is free. Enabling an API (gcloud services enable compute.googleapis.com) is free by itself; the resources you create afterwards may be metered.
gcloud logging read for denied calls
Purpose. Reads audit log entries that failed with PERMISSION_DENIED (status code 7). This is the proof step of the triage.
gcloud logging read \ 'protoPayload.status.code=7 AND protoPayload.authenticationInfo.principalEmail="USER_EMAIL"' \ --project=PROJECT_ID --freshness=1h --limit=5 \ --format="table(timestamp,protoPayload.methodName,protoPayload.resourceName)"
TIMESTAMP METHOD_NAME RESOURCE_NAME 2026-11-25T09:14:03.120Z CreateProject projects/lz-demo
Common errors. No rows can mean the denied call was recorded in another project or at the organization or folder, or that the log reading permission is missing (roles/logging.viewer). Reading logs is free for the query itself.
gcloud projects undelete (write)
Purpose. Restores a project that is pending deletion. It changes the lifecycle state back to ACTIVE. It is the only write in this tab and it is part of Case 5.
gcloud projects undelete PROJECT_ID
Restored project [https://cloudresourcemanager.googleapis.com/v1/projects/PROJECT_ID].
Cost. Free by itself. Resources inside the project may start billing again if they were running. Some resources are not recoverable, so verify after restore.
Lab: reproduce two cases in a sandbox (about 12 minutes, free or very low cost)
Goal. Reproduce Case 10 (API not enabled) and Case 8 (wrong principal type) safely, and practice the read-only diagnosis.
Prerequisites. A sandbox project (not production, no real data), a budget set on its billing account, and a test Google group or a second test user. IDs in the expected output are illustrative.
- Set the project:
gcloud config set project PROJECT_ID, then checkgcloud config list. - Case 10: list enabled APIs and confirm the Cloud Source Repositories or Pub/Sub API is not enabled:
gcloud services list --enabled --filter="config.name:pubsub.googleapis.com". The result must be empty. - Try a call that needs it:
gcloud pubsub topics list. Read the error and note the activation URL. - Enable the API (free):
gcloud services enable pubsub.googleapis.com. Repeat the list command. It must now return an empty list without error. - Case 8: bind a role with the wrong principal type. Grant
roles/pubsub.viewertouser:GROUP_EMAILand see that the group members are not covered:gcloud projects add-iam-policy-binding PROJECT_ID \ --member="user:GROUP_EMAIL" --role="roles/pubsub.viewer"
- Check the policy with the filter from the commands tab. The member is stored as
user:..., notgroup:..., so the group does not inherit the role. - Fix it: remove the wrong binding with
gcloud projects remove-iam-policy-bindingand add--member="group:GROUP_EMAIL". Verify withget-iam-policy.
ERROR: (gcloud.pubsub.topics.list) PERMISSION_DENIED: Cloud Pub/Sub API has not been used in project 123456789012 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/pubsub.googleapis.com/overview?project=123456789012
Expected result. You can show the error before the fix, the policy output that proves the wrong member type, and the clean output after the fix.
Cost. Free. No resources are created. Budgets send alerts and do not cap spend, so keep the sandbox small anyway.
Cleanup. Remove the role binding you added (both wrong and right versions), then optionally disable the API: gcloud services disable pubsub.googleapis.com. Confirm with get-iam-policy.
Real cases
- Onboarding wave. A platform team created fifty projects in a day. Thirty failed to link billing because the billing user role was on a different billing account. A project factory that validates the billing account before creation removed the failures.
- Accidental deletion. A contractor deleted a project named like a test. A lien on every production project and a "delete requires approval" rule in Terraform turned an incident into a rejected request.
- Pipeline lockout. A repository was renamed and every pipeline that used Workload Identity Federation stopped working. The condition matched the old repository name. Binding the pool by repository ID in the attribute mapping made renames safe.
Practices
- Create projects only through code, from a folder, with a billing account and labels in the same change.
- Grant roles to groups, not users. Review group membership instead of project bindings.
- Set
constraints/compute.skipDefaultNetworkCreationandconstraints/iam.disableServiceAccountKeyCreationon the organization. - Put liens on production projects (
gcloud alpha resource-manager liens create; check the help for the flags in your SDK version). - Alert on
SetIamPolicyevents and on repeatedPERMISSION_DENIEDfrom one principal.
roles/owner, roles/editor or by creating a service account key. Use the narrowest predefined role at the lowest scope, and use impersonation for testing.Case index
| Case | Symptom in one line | First check |
|---|---|---|
| 1 | Project creation denied | Role on the parent folder |
| 2 | Billing is not enabled for the project | gcloud billing projects describe |
| 3 | A default network appears in new projects | Effective skipDefaultNetworkCreation |
| 4 | Cannot link more projects to a billing account | Project link limit on the billing account |
| 5 | Project deleted by mistake | lifecycleState of the project |
| 6 | Folder cannot be deleted | Children of the folder |
| 7 | Role granted but still denied | Binding exists, wait and retry |
| 8 | Group members have no access | Member prefix group: versus user: |
| 9 | Role present but a deny policy blocks | Policy Troubleshooter |
| 10 | SERVICE_DISABLED on an API call | gcloud services list --enabled |
| 11 | Access disappears at a fixed time | Expression of the conditional binding |
| 12 | Service account key creation blocked | Effective iam.disableServiceAccountKeyCreation |
| 13 | Federated CI job cannot get a token | Provider attribute condition |
Triage order
- Confirm the identity:
gcloud auth listandgcloud config list. - Confirm the scope and the resource in the error message.
- Check allow bindings, then deny policies, then conditions.
- Read the effective Organization Policy.
- Check that the API is enabled and billing is linked.
- Prove it in the audit log, then change one thing and test again.
Case 1. Project creation denied
Symptom. ERROR: (gcloud.projects.create) PERMISSION_DENIED: The caller does not have permission, or the same message through Terraform.
Cause. The caller lacks resourcemanager.projects.create on the parent folder or organization, or the folder is not the one the pipeline expects.
gcloud resource-manager folders get-iam-policy FOLDER_ID \ --flatten="bindings[].members" --filter="bindings.members:USER_EMAIL" \ --format="table(bindings.role)" gcloud logging read 'protoPayload.methodName:"CreateProject" AND protoPayload.status.code=7' \ --organization=ORG_ID --freshness=1d --limit=3
Fix. Grant roles/resourcemanager.projectCreator to the automation group on the target folder only, not the organization. Add roles/billing.user on the billing account separately.
Prevention. Only the project factory service account creates projects. Humans request projects through a pull request.
Case 2. Billing is not enabled for the project
Symptom. API calls fail with BILLING_DISABLED or This API method requires billing to be enabled.
Cause. The project was created but never linked to a billing account, or the link was removed when a billing account closed.
gcloud billing projects describe PROJECT_ID gcloud billing accounts list --filter="open=true"
Fix. Link the project to an open account: gcloud billing projects link PROJECT_ID --billing-account=BILLING_ACCOUNT_ID. The caller needs roles/billing.user on the account and resourcemanager.projects.createBillingAssignment on the project. This write is free.
Prevention. Make the billing account a required input of the project factory and add a budget in the same change.
Case 3. A default network appears in new projects
Symptom. A new project has a network named default with a subnet in every region and permissive firewall rules (SSH, RDP, ICMP).
Cause. The Compute Engine API creates the default network when it is first enabled, unless constraints/compute.skipDefaultNetworkCreation is enforced.
gcloud compute networks list --project=PROJECT_ID gcloud org-policies describe compute.skipDefaultNetworkCreation --project=PROJECT_ID --effective
Fix. Delete the default firewall rules, then the network: gcloud compute networks delete default --project=PROJECT_ID (delete dependent firewall rules first). Enforce the constraint on the organization or the folder.
Prevention. Enforce compute.skipDefaultNetworkCreation at the organization and attach new projects to a Shared VPC subnet.
Case 4. Cannot link more projects to a billing account
Symptom. Linking fails with a message that the billing account has reached its project limit, or that the quota for projects was exceeded.
Cause. Billing accounts have a limit on linked projects, and new or sandbox accounts have a lower limit. Project creation can also hit a per-user limit.
gcloud billing projects list --billing-account=BILLING_ACCOUNT_ID --format="value(projectId)" gcloud projects list --filter="lifecycleState=DELETE_REQUESTED" --format="value(projectId)"
Fix. Unlink or delete abandoned projects. Projects pending deletion may still count until they are removed. Request a limit increase from Google Cloud support through the quota page or ask the billing owner to add a second billing account.
Prevention. Track linked projects per billing account in the project factory and alert at 80 percent of the limit.
Case 5. Project deleted by mistake
Symptom. Workloads fail, the console says the project is scheduled for deletion, or projects describe returns lifecycleState: DELETE_REQUESTED.
Cause. Someone ran gcloud projects delete or Terraform destroyed the project. The project is in a pending-deletion period.
gcloud projects describe PROJECT_ID --format="value(lifecycleState,parent)" gcloud logging read 'protoPayload.methodName="DeleteProject"' --organization=ORG_ID --freshness=7d --limit=3
Fix. Run gcloud projects undelete PROJECT_ID before the period ends, then check billing, APIs and the state of each resource. Resources that were deleted in the meantime are not restored.
Prevention. Put a lien on production projects, set deletion_policy or prevent_destroy in Terraform, and alert on DeleteProject events.
Case 6. Folder cannot be deleted
Symptom. FAILED_PRECONDITION: Folder is not empty or a similar message when deleting a folder.
Cause. The folder still has projects (including projects pending deletion) or subfolders. Active liens on a project also block deletion.
gcloud projects list --filter="parent.id=FOLDER_ID AND parent.type=folder" --format="table(projectId,lifecycleState)" gcloud resource-manager folders list --folder=FOLDER_ID
Fix. Move the projects to another folder (gcloud projects move PROJECT_ID --folder=OTHER_FOLDER_ID) or delete them, then delete the folder: gcloud resource-manager folders delete FOLDER_ID. Projects pending deletion keep the folder in use until they are removed.
Prevention. Manage folders in Terraform and review the children before removing a folder from code.
Case 7. Role granted but still denied
Symptom. A user received a role a few minutes ago and still sees PERMISSION_DENIED.
Cause. IAM is eventually consistent, or the role was granted on a different resource (for example the wrong project), or the permission is not in the role.
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:USER_EMAIL" --format="table(bindings.role)" gcloud iam roles describe roles/ROLE_NAME --format="value(includedPermissions)"
Fix. If the binding and the permission are correct, wait a few minutes and retry with a fresh token (gcloud auth print-access-token is not needed for normal CLI use). If the permission is missing, choose a predefined role that includes it.
Prevention. Tell users to expect a short delay. Use Policy Troubleshooter to prove access before you open an incident.
Case 8. Group members have no access
Symptom. A role was granted to a group, but members cannot use it. In the policy the member shows as user:team@example.com.
Cause. The member was written with the wrong prefix. A group needs group:, a service account needs serviceAccount:. A user prefix with a group address matches no person.
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:GROUP_EMAIL" --format="table(bindings.role,bindings.members)"
Fix. Remove the wrong binding and add group:GROUP_EMAIL. Verify membership in the admin console or with Cloud Identity group commands (check gcloud identity groups --help).
Prevention. Generate bindings from a typed Terraform variable (group, user, serviceAccount lists), never from free-text strings.
Case 9. Role present but a deny policy blocks
Symptom. The user holds the right role, Policy Troubleshooter or the error shows denied by IAM deny policy.
Cause. A deny policy attached to the organization, a folder or the project denies the permission for the principal. Deny always overrides allow.
gcloud policy-troubleshoot iam //cloudresourcemanager.googleapis.com/projects/PROJECT_ID --principal-email=USER_EMAIL --permission=PERMISSION gcloud iam policies list --attachment-point=cloudresourcemanager.googleapis.com/projects/PROJECT_ID --kind=denypolicies
Fix. Add the principal to the exception list of the deny rule, or remove the rule if it is wrong. Review the rule through code review. Check gcloud iam policies --help for the flags in your SDK version.
Prevention. Keep deny policies in one Terraform module with a comment per rule and an owner.
Case 10. SERVICE_DISABLED on an API call
Symptom. PERMISSION_DENIED: ... API has not been used in project ... before or it is disabled with an activation URL.
Cause. The API is not enabled in the project that the request is billed to. Client tools may use a different quota project than you expect.
gcloud services list --enabled --project=PROJECT_ID --filter="config.name:SERVICE_NAME" gcloud config get-value billing/quota_project
Fix. gcloud services enable SERVICE_NAME --project=PROJECT_ID (free). Wait for the change to propagate, then retry. If a user credential is billed to the wrong project, set the quota project.
Prevention. List required APIs per project type in the project factory. Restrict API use with constraints/serviceuser.services only if your standard requires it.
Case 11. Access disappears at a fixed time
Symptom. A contractor had access in the morning and none after a certain hour.
Cause. The binding has an IAM Condition with a time expression (for example request.time < timestamp(...)) that expired, or a condition on resource name that no longer matches.
gcloud projects get-iam-policy PROJECT_ID --format="yaml(bindings)" | grep -B3 -A6 "expression"
Fix. Extend or replace the conditional binding with a new expiry after approval. Do not remove the condition to "fix" the symptom.
Prevention. Alert owners seven days before an expiry and keep the expiry in the access request ticket.
Case 12. Service account key creation blocked
Symptom. FAILED_PRECONDITION: Key creation is not allowed on this service account and a mention of constraints/iam.disableServiceAccountKeyCreation.
Cause. The Organization Policy is enforced, which is the intended landing zone behaviour. A tool or a developer still tries to create a key file.
gcloud org-policies describe iam.disableServiceAccountKeyCreation --project=PROJECT_ID --effective gcloud iam service-accounts keys list --iam-account=SA_EMAIL
Fix. Do not turn the constraint off. Use Workload Identity Federation for external systems and impersonation for developers: gcloud ... --impersonate-service-account=SA_EMAIL.
Prevention. Document the keyless patterns in the developer guide and make a short exception process for legacy systems, with expiry.
Case 13. Federated CI job cannot get a token
Symptom. The GitHub Actions step fails with unauthorized_client, The given credential is rejected by the attribute condition or Permission 'iam.serviceAccounts.getAccessToken' denied.
Cause. The provider attribute condition does not match the claims (repository, branch, environment), or the service account has no roles/iam.workloadIdentityUser binding for the right principalSet.
gcloud iam workload-identity-pools providers describe PROVIDER_ID \ --workload-identity-pool=POOL_ID --location=global \ --format="yaml(attributeCondition,attributeMapping)" gcloud iam service-accounts get-iam-policy SA_EMAIL --format="yaml(bindings)"
Fix. Align the condition and the principalSet with the real claims (for example assertion.repository=="ORG/REPO"). Add the binding principalSet://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/attribute.repository/ORG/REPO to the service account.
Prevention. Use the repository ID, not only the name, in mappings, test the pool in a sandbox repository, and keep one service account per layer.
Video links change often, so the links below are search pages rather than pinned video links. Check the date of a video against the version of the documentation you use.
- YouTube search: Google Cloud IAM permission denied troubleshooting
- YouTube search: Workload Identity Federation with GitHub Actions
- YouTube search: Organization Policy constraints
Official reading: Troubleshoot access (IAM) · Creating and managing projects · Workload Identity Federation.
Module 2 · Network cases
- Trace a failing connection along the packet path: route, firewall, NAT or private access, DNS, then the remote end.
- Diagnose 13 recurring network cases with read-only gcloud commands and Connectivity Tests.
- Prevent each case with a standard in the network layer of the landing zone.
The short answer
Network failures in a landing zone are rarely "the network is down". They are almost always a missing or wrong object in the packet path: a route, a firewall rule, a NAT gateway, a private zone attachment, a subnet permission or a BGP peer. This module gives you 13 recurring cases (Case 14 to Case 26) and one method: follow the packet.
What: the packet path in Google Cloud
- VPC network: global; subnets are regional. Routes and firewall rules belong to the network, not to a subnet.
- Routes: the most specific destination wins. Subnet routes exist automatically; the default route to the internet gateway is a custom static route that can be removed.
- Firewall rules and policies: stateful. Hierarchical firewall policies (organization and folder) are evaluated before VPC rules. Implied rules: allow all egress, deny all ingress.
- Egress: external IP, Cloud NAT, or Private Google Access for Google APIs.
- DNS: the metadata server resolves internal names and private zones that are attached to the network.
- Hybrid: HA VPN or Interconnect with a Cloud Router and BGP, plus MTU settings on both sides.
Why: connection problems cost the most time
Network issues cross team boundaries: application, platform, network and sometimes the on-premises team. A shared case book gives each side the same first questions, and Connectivity Tests give them the same evidence.
How it works: the decision logic
| Step | Question | Evidence |
|---|---|---|
| 1. Name | Does the name resolve to the address you expect? | nslookup or dig from the VM |
| 2. Route | Is there a route to the destination, and which one is chosen? | gcloud compute routes list, Connectivity Test |
| 3. Firewall | Which policy or rule allows or denies this tuple? | gcloud compute firewall-rules list --sort-by=priority, firewall logs |
| 4. Egress | Is there NAT, an external IP or private access? | gcloud compute routers nats describe |
| 5. Remote end | Does the service listen and allow the source? | curl -v, remote logs |
| 6. Size and path | Do large packets pass, and do both directions use the same path? | ping -M do -s, VPN and router status |
When to use Connectivity Tests
Use them whenever you can name the two endpoints. A test costs nothing to read and reports the first dropping hop. Use packet-level tools (VPC Flow Logs, firewall rule logging, tcpdump) when the configuration looks right but traffic still fails.
What it is confused with
| Looks like | But it is | How to tell |
|---|---|---|
| Firewall block | No route or no NAT | Connection hangs rather than being refused; firewall logs show nothing |
| DNS failure | Private zone not attached | NXDOMAIN only inside some VPCs |
| VPN down | BGP or route advertisement problem | Tunnel is ESTABLISHED, session is not |
| Application slow | MTU or NAT port exhaustion | Small requests work, large ones stall |
| Subnet missing | Missing roles/compute.networkUser | The subnet exists in the host project but is not listed for the service project |
Three common misunderstandings
- "VPC peering is transitive." It is not. Spoke to spoke traffic needs another design (a hub with Network Connectivity Center, a VPN, or a proxy).
- "Allow rules at priority 1000 always win." A deny with a lower number or a hierarchical policy rule is evaluated first.
- "Cloud NAT is a firewall." It translates outbound connections only. It does not block anything and does not accept unsolicited inbound traffic.
Figure 1. The packet path. Each box is a place where a case in this module ends: no route, a firewall rule, no NAT, a bad tunnel.
Figure 2. Shared VPC. A service project can use only the subnets on which its principals have the network user role (Case 17).
The animation follows one outbound request from a private VM through routing, the firewall and Cloud NAT. Each step is a decision that real logs record. When a case in this module says "no egress", it is one of these steps missing.
Use these to diagnose before changing anything. Write commands are marked and say whether they cost money. Check gcloud ... --help for the flags in your SDK version.
gcloud compute firewall-rules list --sort-by
Purpose. Shows VPC firewall rules in priority order so that conflicts are visible.
gcloud compute firewall-rules list --project=PROJECT_ID \ --filter="network:NETWORK_NAME" --sort-by=priority \ --format="table(name,direction,priority,sourceRanges.list(),allowed[].map().firewall_rule().list(),disabled)"
NAME DIRECTION PRIORITY SRC_RANGES ALLOW DISABLED deny-egress-risky EGRESS 500 0.0.0.0/0 False allow-iap-ssh INGRESS 1000 35.235.240.0/20 tcp:22 False
Common errors. This list shows only VPC rules. Hierarchical firewall policies are separate: gcloud compute firewall-policies list --organization=ORG_ID. Reading is free.
gcloud compute routers nats describe and get-status
Purpose. Shows the Cloud NAT configuration and the Cloud Router status, including allocated addresses.
gcloud compute routers nats describe NAT_NAME --router=ROUTER_NAME --region=REGION --project=PROJECT_ID gcloud compute routers get-status ROUTER_NAME --region=REGION --project=PROJECT_ID
name: nat-egress natIpAllocateOption: AUTO_ONLY sourceSubnetworkIpRangesToNat: ALL_SUBNETWORKS_ALL_IP_RANGES minPortsPerVm: 64 logConfig: enable: true filter: ERRORS_ONLY
Common errors. NOT_FOUND means there is no NAT in that region. NAT is regional: a NAT in europe-west1 does not serve VMs in us-central1. Reading is free; a running NAT gateway is a metered resource.
gcloud compute networks subnets list-usable
Purpose. From a service project, lists the Shared VPC subnets that the caller may use. A missing subnet points to a permission problem.
gcloud compute networks subnets list-usable --project=SERVICE_PROJECT_ID
PROJECT REGION NETWORK SUBNET RANGE HOST_PROJECT europe-west1 shared subnet-a 10.10.0.0/24
gcloud compute vpn-tunnels describe
Purpose. Shows the state of an HA VPN tunnel and the detailed status (for example ESTABLISHED, NO_INCOMING_PACKETS or NEGOTIATION_FAILURE).
gcloud compute vpn-tunnels describe TUNNEL_NAME --region=REGION --project=PROJECT_ID \ --format="value(status,detailedStatus)"
ESTABLISHED Tunnel is up and running.
Common errors. FIRST_HANDSHAKE or NO_INCOMING_PACKETS usually means the peer is not sending IKE (wrong peer IP, firewall on the peer). Free to read.
gcloud network-management connectivity-tests create (write, metadata)
Purpose. Creates a Connectivity Test between two endpoints and analyzes the configured path.
gcloud network-management connectivity-tests create TEST_NAME \ --source-instance=projects/PROJECT_ID/zones/ZONE/instances/VM_A \ --destination-ip-address=10.20.0.10 --destination-port=443 --protocol=TCP \ --project=PROJECT_ID gcloud network-management connectivity-tests describe TEST_NAME --project=PROJECT_ID \ --format="yaml(reachabilityDetails.result)"
reachabilityDetails: result: UNREACHABLE
Cost. Creating a test and reading its result are free for small numbers of tests; check the current pricing page if you run many. Delete the test when done: gcloud network-management connectivity-tests delete TEST_NAME. Check --help for the flags in your SDK version.
Lab: reproduce Case 14 and Case 21 in a sandbox (about 20 minutes, low cost)
Goal. See a private VM fail to reach the internet, fix it with Cloud NAT, and use a Connectivity Test to prove the path. IDs in the expected output are illustrative.
Prerequisites. A sandbox project with billing and a budget, roles/compute.admin and roles/compute.networkAdmin, and a custom-mode VPC with one subnet. Do not use a production network.
- Create a VPC and subnet (free):
gcloud compute networks create lab-net --subnet-mode=customthengcloud compute networks subnets create lab-subnet --network=lab-net --region=REGION --range=10.50.0.0/24. - Allow IAP SSH, the right way (Case 21):
gcloud compute firewall-rules create lab-allow-iap --network=lab-net --direction=INGRESS --allow=tcp:22 --source-ranges=35.235.240.0/20. - Create a small VM with no external IP (metered, low cost):
gcloud compute instances create lab-vm --zone=ZONE --subnet=lab-subnet --no-address --machine-type=e2-micro. - Connect through IAP:
gcloud compute ssh lab-vm --zone=ZONE --tunnel-through-iap. Inside the VM runcurl -m 5 -sI https://www.google.com. It must time out (Case 14). - Back in Cloud Shell, create the router and NAT (metered while it exists):
gcloud compute routers create lab-router --network=lab-net --region=REGION gcloud compute routers nats create lab-nat --router=lab-router --region=REGION \ --auto-allocate-nat-external-ips --nat-all-subnet-ip-ranges
- Repeat the
curlinside the VM after about a minute. It must return an HTTP status line. - Remove the firewall rule and run a Connectivity Test from the VM to an internal IP to see a firewall drop; recreate the rule to restore.
HTTP/2 200 content-type: text/html; charset=ISO-8859-1
Expected result. The first curl times out, the second succeeds after NAT is created, and the Connectivity Test names the firewall rule that dropped the packet.
Cost. Low (usually well under a few USD per day for this lab). Budgets send alerts and do not cap spend. Delete everything at the end.
Cleanup, in this order.
gcloud compute instances delete lab-vm --zone=ZONE --quiet gcloud compute routers nats delete lab-nat --router=lab-router --region=REGION --quiet gcloud compute routers delete lab-router --region=REGION --quiet gcloud compute firewall-rules delete lab-allow-iap --quiet gcloud compute networks subnets delete lab-subnet --region=REGION --quiet gcloud compute networks delete lab-net --quiet
Real cases
- Order of changes. A team added a deny rule at priority 500 for a risky port range during an incident. The rule also matched the health check range and took a load balancer out of service. Rules now carry a named owner and a Connectivity Test is part of the change request.
- NAT ports at launch. A batch job opened thousands of short connections to one API. The NAT gateway ran out of ports and calls failed in bursts. More NAT addresses, a higher minimum ports per VM and connection reuse fixed it.
- On-premises overlap. A new spoke used a range that existed on-premises. Routes were learned but traffic never arrived. An IP address plan kept in code, with an overlap check in CI, ended the problem.
Practices
- One IP plan for all VPCs and on-premises, reviewed by the network team before any subnet is created.
- Enable Cloud NAT logging for errors and firewall rule logging on deny rules that matter.
- Standard ingress rules: IAP range for SSH, health check ranges for load balancers, nothing else from the internet by default.
- Use hierarchical firewall policies for rules that must never be overridden and VPC rules for application rules.
0.0.0.0/0 on SSH or RDP to "make it work". Use IAP TCP forwarding and OS Login. An open rule found during an incident should be closed first and investigated second.Case index
| Case | Symptom in one line | First check |
|---|---|---|
| 14 | Private VM has no internet access | Cloud NAT in the VM region |
| 15 | Intermittent outbound failures at high load | NAT port allocation and drop counters |
| 16 | Private zone does not resolve | Networks attached to the zone |
| 17 | Shared subnet not visible in service project | list-usable and subnet IAM |
| 18 | Allow rule exists but traffic is blocked | Priority and rule order |
| 19 | Subnet or peering fails: range overlaps | IP plan and existing ranges |
| 20 | Private VM cannot reach Google APIs | Private Google Access on the subnet |
| 21 | IAP SSH fails | Firewall rule for 35.235.240.0/20 |
| 22 | Load balancer backends unhealthy | Health check ranges in the firewall |
| 23 | Hierarchical policy overrides a project rule | Firewall policy rules and actions |
| 24 | Spoke to spoke over peering fails | Transitive routing is not supported |
| 25 | VPN tunnel up, BGP session idle | Peer IP, ASN and router status |
| 26 | Large transfers stall over VPN | MTU on both ends |
Triage order
- Name the source, the destination, the port and the protocol.
- Resolve the name from the source.
- Run a Connectivity Test and read the first dropping hop.
- Read firewall policies and rules in priority order, then routes.
- Check NAT or private access, then hybrid status.
- Only then use flow logs, packet captures or the remote end logs.
Case 14. Private VM has no internet access
Symptom. apt update or curl hangs and times out from a VM with no external IP.
Cause. No Cloud NAT in the region of the subnet, or NAT does not include that subnet range, or the default route to the internet was deleted.
gcloud compute routers nats list --router=ROUTER_NAME --region=REGION --project=PROJECT_ID gcloud compute routes list --project=PROJECT_ID --filter="network:NETWORK_NAME AND destRange=0.0.0.0/0"
Fix. Create a Cloud Router and a NAT in the VM region with --nat-all-subnet-ip-ranges (metered while it exists), or restore the default route. Retry after a minute.
Prevention. The network layer creates a router and NAT in every active region, and the project factory checks the default route.
Case 15. Intermittent outbound failures at high load
Symptom. Sporadic connection resets or timeouts to the same external service during peaks. NAT logs show OUT_OF_RESOURCES or dropped connections.
Cause. Cloud NAT allocates a limited number of ports per VM and per destination tuple. Many concurrent connections to one destination exhaust them.
gcloud compute routers nats describe NAT_NAME --router=ROUTER_NAME --region=REGION --format="yaml(minPortsPerVm,enableDynamicPortAllocation,natIps)" gcloud logging read 'resource.type="nat_gateway" AND jsonPayload.allocation_status="DROPPED"' --freshness=1h --limit=5
Fix. Add NAT addresses, increase minPortsPerVm, enable dynamic port allocation, and fix the application to reuse connections. Check gcloud compute routers nats update --help for the flags.
Prevention. Alert on the NAT dropped-connection metric and load test egress paths before launch.
Case 16. Private zone does not resolve
Symptom. NXDOMAIN or a public address for an internal name, but only in some VPCs.
Cause. The private managed zone is not attached to the VPC of the VM, or a forwarding zone or response policy takes priority, or the name is in a different project's zone.
gcloud dns managed-zones describe ZONE_NAME --project=PROJECT_ID --format="yaml(visibility,privateVisibilityConfig)" gcloud dns record-sets list --zone=ZONE_NAME --project=PROJECT_ID --filter="name:HOSTNAME"
Fix. Add the network: gcloud dns managed-zones update ZONE_NAME --networks=NET1,NET2 (list every network, the flag replaces the set). Test again from the VM with nslookup HOSTNAME.
Prevention. Manage zones and their networks in Terraform, and use a central DNS project with DNS peering for shared zones.
Case 17. Shared subnet not visible in the service project
Symptom. Creating a VM or GKE cluster in the service project fails with The resource 'projects/HOST/regions/REGION/subnetworks/SUBNET' was not found or a permission error.
Cause. The service project is not attached to the host project, or the principal creating the resource has no roles/compute.networkUser on that subnet.
gcloud compute shared-vpc get-host-project SERVICE_PROJECT_ID gcloud compute networks subnets get-iam-policy SUBNET --region=REGION --project=HOST_PROJECT_ID
Fix. Attach the project: gcloud compute shared-vpc associated-projects add SERVICE_PROJECT_ID --host-project=HOST_PROJECT_ID. Grant the network user role at subnet level to the deployer and, for GKE or managed services, to their service agents.
Prevention. Project factory attaches the project and grants subnet-level roles in the same change.
Case 18. Allow rule exists but traffic is blocked
Symptom. An allow rule for the application port exists, yet connections are refused or time out.
Cause. A deny rule with a lower priority number matches the same traffic, or the allow rule has target tags or service accounts that the VM does not carry, or the rule is disabled.
gcloud compute firewall-rules list --filter="network:NETWORK_NAME" --sort-by=priority --format="table(name,direction,priority,disabled,targetTags.list())" gcloud compute instances describe VM_NAME --zone=ZONE --format="value(tags.items)"
Fix. Give the allow rule a lower number than the deny rule, or narrow the deny rule. Match the tag or service account on the VM.
Prevention. Reserve priority bands (for example 100–499 guardrails, 1000 application, 65000 catch-all) and document them.
Case 19. Subnet or peering fails: range overlaps
Symptom. Invalid IPCidrRange ... conflicts with existing subnetwork, or a peering stays INACTIVE, or on-premises traffic goes to the wrong place.
Cause. Two networks use overlapping CIDR ranges. Google Cloud cannot create peering or route correctly between overlapping ranges.
gcloud compute networks subnets list --project=PROJECT_ID --format="table(name,region,ipCidrRange)" gcloud compute networks peerings list --project=PROJECT_ID
Fix. Choose a free range from the plan. Existing subnets can be expanded but not shifted; for a collision, create a new subnet and migrate workloads.
Prevention. Keep the IP plan in code and fail the pull request if a range overlaps any other.
Case 20. Private VM cannot reach Google APIs
Symptom. From a VM without an external IP, gcloud storage ls or API calls time out, while internal traffic works.
Cause. Private Google Access is off on the subnet and there is no NAT, or DNS resolves googleapis.com to a range that is not routed.
gcloud compute networks subnets describe SUBNET --region=REGION --project=PROJECT_ID --format="value(privateIpGoogleAccess)" nslookup storage.googleapis.com
Fix. gcloud compute networks subnets update SUBNET --region=REGION --enable-private-ip-google-access (free). For restricted APIs, use restricted.googleapis.com with matching DNS and routes.
Prevention. Enable it in the subnet module by default.
Case 21. IAP SSH fails
Symptom. gcloud compute ssh --tunnel-through-iap returns failed to connect to backend (error 4003 or 4033).
Cause. No ingress rule allows 35.235.240.0/20 on port 22 to the VM, or the user lacks roles/iap.tunnelResourceAccessor, or the VM has no SSH daemon.
gcloud compute firewall-rules list --filter="sourceRanges:35.235.240.0/20" --format="table(name,network,allowed[].map().firewall_rule().list())" gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.role=roles/iap.tunnelResourceAccessor"
Fix. Create the firewall rule for the IAP range on tcp:22 (free) and grant the tunnel role to the group. Add OS Login roles if OS Login is enforced (Module 4).
Prevention. The network layer deploys the IAP rule in every VPC.
Case 22. Load balancer backends unhealthy
Symptom. Backends show UNHEALTHY although the application answers on the port locally. Users see 502 errors.
Cause. The firewall blocks Google health check probes, which come from 130.211.0.0/22 and 35.191.0.0/16 (and other ranges for some load balancer types).
gcloud compute backend-services get-health BACKEND_SERVICE --global --project=PROJECT_ID gcloud compute firewall-rules list --filter="sourceRanges:35.191.0.0/16" --format="table(name,allowed[].map().firewall_rule().list())"
Fix. Allow the documented health check ranges to the serving port. Check the load balancer documentation for the ranges of your load balancer type.
Prevention. Standard rule in the network module, and a Connectivity Test from the probe range to the backend after changes.
Case 23. Hierarchical policy overrides a project rule
Symptom. A project owner opens a port with a VPC rule and it has no effect. Or a rule in the policy cannot be overridden.
Cause. Organization and folder firewall policies are evaluated before VPC rules. A deny or allow action there is final; only goto_next passes control down.
gcloud compute firewall-policies list --organization=ORG_ID gcloud compute firewall-policies rules list --firewall-policy=POLICY_ID --organization=ORG_ID
Fix. Change the policy rule through the platform team, or use goto_next for rules that application teams may refine. Check --help for the flags in your SDK version.
Prevention. Document which rules are guardrails and which are delegated, and use the Connectivity Test to show the evaluated order.
Case 24. Spoke to spoke over peering fails
Symptom. VPC A can reach hub H, H can reach VPC B, but A cannot reach B.
Cause. VPC Network Peering is not transitive. Routes learned from one peer are not passed to another peer.
gcloud compute networks peerings list --network=NETWORK_NAME --project=PROJECT_ID gcloud compute routes list --project=PROJECT_ID --filter="network:NETWORK_NAME" --format="table(name,destRange,nextHopPeering)"
Fix. Use Network Connectivity Center with VPC spokes, a VPN between the VPCs, or a proxy. Peer A and B directly only if the scale permits.
Prevention. Draw the topology and test A to B before the design is approved.
Case 25. VPN tunnel up, BGP session idle
Symptom. The tunnel is ESTABLISHED but the Cloud Router shows the BGP session as Idle or Active, and no routes are learned.
Cause. The peer BGP IP, the peer ASN or the interface does not match, or the peer does not advertise, or the shared secret mismatch kept the tunnel from stabilizing earlier.
gcloud compute routers get-status ROUTER_NAME --region=REGION --format="yaml(result.bgpPeerStatus)" gcloud compute routers describe ROUTER_NAME --region=REGION --format="yaml(bgp,bgpPeers)"
Fix. Align the BGP peer IP, ASN and interface on both sides, and check that the peer allows TCP 179 to the link-local address. Compare the shared secret and IKE version if the tunnel flaps.
Prevention. Generate both sides from one configuration, and monitor tunnel and BGP status with alerts.
Case 26. Large transfers stall over VPN
Symptom. Ping and small requests work, but uploads, TLS handshakes or database dumps hang.
Cause. MTU mismatch: packets larger than the path allows are dropped and the fragmentation needed message is lost or blocked.
ping -M do -s 1372 10.20.0.10 gcloud compute networks describe NETWORK_NAME --format="value(mtu)"
Fix. Lower the MTU or enable MSS clamping on the peer device, and confirm the VPC MTU setting (default 1460). Retest with decreasing packet sizes.
Prevention. Document the MTU for each hybrid path and include a large-packet test in the acceptance checklist.
Video links change often, so the links below are search pages rather than pinned video links. Check the date of a video against the documentation you use.
- YouTube search: Connectivity Tests and Network Intelligence Center
- YouTube search: Cloud NAT troubleshooting
- YouTube search: HA VPN and BGP troubleshooting
Official reading: Connectivity Tests · Cloud NAT overview · Troubleshooting Cloud VPN.
Module 3 · Logging, cost and IaC cases
- Find the missing link in a log pipeline: source, filter, sink, destination permission and retention.
- Explain why budgets alert but do not cap spend, and diagnose cost spikes and missing billing data.
- Diagnose Terraform failures (state lock, API not enabled, provider change, drift) and prevent them with pipeline rules.
The short answer
Logging, cost and IaC failures share one property: they are silent. A wrong exclusion filter, a sink without permission, a budget that only warns, or a Terraform plan that nobody runs on a schedule do not break production immediately. They break your ability to prove what happened, to limit spend, or to change the platform safely. This module has 12 cases (Case 27 to Case 38).
What: three pipelines to understand
- Log pipeline: a source writes entries; the Log Router matches sinks and exclusions; entries land in log buckets (
_Required,_Defaultand user buckets) or in external destinations; retention and access control apply. - Cost pipeline: usage is metered per project and labelled; billing data can be exported to BigQuery; budgets compare spend with thresholds and send notifications.
- IaC pipeline: code in a repository, a plan on pull request, an apply after approval, state in a Cloud Storage bucket with locking, and a scheduled drift check.
Why: evidence, limits and repeatability
When an incident happens, you need audit logs that exist, are searchable and cannot be altered by the project owner. When spend rises, you need labels, an export and a budget that reached the right people. When the platform changes, you need a state file that is not corrupt and a pipeline identity that has just enough rights.
How it works: the checks per pipeline
| Pipeline | Check order | Command or place |
|---|---|---|
| Logs | Source writes, API and audit config, exclusion, sink filter, writer identity, destination, retention | gcloud logging read, sinks describe, buckets describe |
| Alerts | Metric or log condition, policy enabled, notification channel verified, incident opened | gcloud monitoring policies list, console |
| Cost | Billing account, labels, export dataset, budget scope and recipients | gcloud billing budgets list, BigQuery |
| Terraform | Lock, backend access, provider and API, CI identity roles, drift | terraform plan, force-unlock, state list |
When to use each approach
Route audit logs to a central, locked project through an organization sink. Use exclusions for noise such as health check requests, but never for audit logs. Use budgets on every project or billing sub-account for early warning. Run drift detection daily for the production layers and weekly for sandboxes.
What it is confused with
| Looks like | But it is | How to tell |
|---|---|---|
| Logs not generated | Logs excluded or not routed | Entries visible in Logs Explorer but not in the sink destination |
| Budget stopped nothing | Budget works as designed | Notifications arrived, no automation was attached |
| Missing cost data | Export started late | Export has no rows before the enable date |
| Terraform bug | Provider upgrade or drift | terraform providers and the plan diff |
| Pipeline 403 | Pipeline identity lacks a role | The audit log shows the pipeline service account as the principal |
Three common misunderstandings
- "Budgets protect me from big bills." They warn. The warning can arrive late, because billing data is delayed.
- "Excluding logs is always safe." Excluded entries are gone. Prefer routing noisy logs to cheap storage with a short retention.
- "State is just a cache." State is the record that maps code to real resources. Corrupt or deleted state leads to duplicates and deletions.
Figure 1. The log pipeline. Look at the Log Router first: the exclusion and sink filter decide what reaches each destination (Cases 27 to 32).
Figure 2. The Terraform pipeline. The state bucket and the scheduled drift plan are the two controls that most cases depend on.
The animation follows a log entry through the router to an organization sink, a permission failure on the destination and the fix. It shows why a sink can exist, match and still deliver nothing (Case 28).
Read-only commands first. Write commands are marked and say whether they cost money. Check gcloud ... --help for the flags in your SDK version.
gcloud logging sinks describe
Purpose. Shows the filter, destination, exclusions and writer identity of a sink.
gcloud logging sinks describe SINK_NAME --organization=ORG_ID
destination: storage.googleapis.com/BUCKET_NAME filter: logName:"cloudaudit.googleapis.com" includeChildren: true name: SINK_NAME writerIdentity: serviceAccount:o123456789012-111111@gcp-sa-logging.iam.gserviceaccount.com
Common errors. Missing includeChildren: true on an organization or folder sink means entries from child projects are not routed (Case 29). Free to read.
gcloud logging read
Purpose. Queries log entries from the command line. Use it to prove whether an entry exists at the source.
gcloud logging read 'logName:"cloudaudit.googleapis.com%2Fdata_access" AND protoPayload.serviceName="storage.googleapis.com"' \ --project=PROJECT_ID --freshness=1d --limit=3 --format="value(timestamp,protoPayload.methodName)"
Flags. --freshness limits the age, --limit the rows, --format the fields. If the query returns nothing, the entries are not generated, excluded or older than the retention. Reading is free for normal use.
gcloud projects get-iam-policy --format="yaml(auditConfigs)"
Purpose. Shows which Data Access audit logs are enabled for the project.
gcloud projects get-iam-policy PROJECT_ID --format="yaml(auditConfigs)"
auditConfigs: - auditLogConfigs: - logType: DATA_READ - logType: DATA_WRITE service: storage.googleapis.com
Common errors. An empty result means only Admin Activity is recorded for the project (or the setting is inherited from a folder or the organization). Enabling Data Access logs increases log volume and cost.
gcloud billing budgets list
Purpose. Lists budgets of a billing account to check scope, threshold rules and notification setup.
gcloud billing budgets list --billing-account=BILLING_ACCOUNT_ID
NAME DISPLAY_NAME AMOUNT billingAccounts/0X0X0X-0X0X0X-0X0X0X/budgets/abc lab-budget 100
Common errors. PERMISSION_DENIED means you need roles/billing.viewer or a budget viewer role on the billing account. Free.
terraform plan -detailed-exitcode
Purpose. Plans without changing anything and returns exit code 0 (no changes), 1 (error) or 2 (changes present). Used for drift detection.
terraform plan -detailed-exitcode -lock-timeout=60s -out=tfplan; echo "exit=$?"
Plan: 0 to add, 1 to change, 0 to destroy. exit=2
Flags. -lock-timeout waits for a lock instead of failing at once. -out saves the plan so that apply uses exactly what was reviewed. Planning costs nothing; apply may create metered resources.
terraform force-unlock (write, state only)
Purpose. Removes a stale state lock. It changes the lock object in the state bucket, not your resources.
terraform force-unlock LOCK_ID
Common errors. Run it only after you confirm that no pipeline or person is applying. The lock ID comes from the error message. Free.
-lock-timeout in every pipeline step, store plan files as build artifacts and attach the plan output to the pull request. Put the five log and cost commands in the incident runbook.Lab: reproduce Case 27 and Case 36 in a sandbox (about 18 minutes, low cost)
Goal. Show that an exclusion on a sink hides entries (Case 27), and that Terraform fails when an API is disabled (Case 36). IDs in the expected output are illustrative.
Prerequisites. A sandbox project with billing and a budget, roles/logging.admin, roles/serviceusage.serviceUsageAdmin, and Terraform 1.x with the Google provider (pin the major version in required_providers). No real data.
- Create a log bucket destination (free):
gcloud logging buckets create lab-logs --location=global --retention-days=7 --project=PROJECT_ID. - Create a sink to it with an exclusion for the lab log name (check
gcloud logging sinks create --helpfor the destination form in your SDK version):gcloud logging sinks create lab-sink \ logging.googleapis.com/projects/PROJECT_ID/locations/global/buckets/lab-logs \ --log-filter='logName:"projects/PROJECT_ID/logs/lab-test"' --project=PROJECT_ID
- Write two entries:
gcloud logging write lab-test "case 27 visible" --severity=INFO. Read it back withgcloud logging read 'logName:"lab-test"' --project=PROJECT_ID --freshness=10m. It is in Logs Explorer (the_Defaultbucket). - Add an exclusion to the
_Defaultsink in the console (Logging, Logs Router, Edit sink, Exclusion filters) withlogName:"lab-test". Write another entry and confirm it is not in_Defaultany more. This is Case 27. - Case 36: in an empty folder write a minimal configuration that creates a
google_pubsub_topicin a project wherepubsub.googleapis.comis disabled. Runterraform initandterraform plan; the apply fails withSERVICE_DISABLED. - Fix by enabling the API:
gcloud services enable pubsub.googleapis.com, or add agoogle_project_serviceresource. Re-run apply, then verify withterraform state list.
Error: Error creating Topic: googleapi: Error 403: Cloud Pub/Sub API has not been used in project PROJECT_NUMBER before or it is disabled.
Expected result. You see the entry disappear from _Default after the exclusion, and a clear 403 from Terraform that the API enable fixes.
Cost. Low (usually well under a few USD per day for this lab). Budgets send alerts and do not cap spend.
Cleanup. Remove the exclusion from _Default, delete the sink and bucket (gcloud logging sinks delete lab-sink, gcloud logging buckets delete lab-logs --location=global), run terraform destroy, and disable the Pub/Sub API if you enabled it only for the lab.
_Required or to audit logs, do not use force-unlock to test locks, and do not change billing settings to test budgets.Real cases
- Missing evidence. A security review needed read access logs for a bucket and found none. Data Access logs had never been enabled. Enabling them for sensitive projects through the organization audit configuration solved it for future events, but not for the past.
- Noisy logging bill. A debug flag left on in a service multiplied log volume. Daily ingestion alerts and a rule that routes debug logs to a short-retention bucket made the cost visible within a day.
- Runaway test project. A load test left a cluster running for a weekend. A budget alert was sent to a mailbox nobody read. Routing budget notifications to the team channel and to Pub/Sub for automation shortened the response to hours.
Practices
- One organization sink for audit logs into a locked project, with CMEK and a long retention, plus separate sinks for security tools.
- Budgets on every project and on every billing account with thresholds and group recipients; export billing data to BigQuery on day one.
- State bucket with versioning, uniform access and a small group of writers; one state per layer; CI identities per layer.
- Daily
plan -detailed-exitcodefor production layers, with the result sent to the platform channel.
Case index
| Case | Symptom in one line | First check |
|---|---|---|
| 27 | Log entries missing in Logs Explorer | Exclusion filters on sinks |
| 28 | Sink exists but destination is empty | Writer identity permission |
| 29 | Organization sink misses child projects | includeChildren and filter |
| 30 | No audit entries for reads | Data Access audit configuration |
| 31 | Alert policy fires but nobody is notified | Notification channel status |
| 32 | Sudden log ingestion cost | Volume by log name and bucket |
| 33 | Spend exceeded the budget | Budget behaviour and recipients |
| 34 | Billing export has missing days | Export enable date and dataset |
| 35 | Terraform state lock error | Active runs, lock ID |
| 36 | Terraform 403 SERVICE_DISABLED | API enabled in the right project |
| 37 | Plan changes after a provider upgrade | Provider version and lock file |
| 38 | Plan shows changes nobody made (drift) | Audit log of the resource |
Triage order
- Decide which pipeline fails: logs, alerts, cost or Terraform.
- Check the source: does the entry, metric or usage exist?
- Check the filter, exclusion or scope that selects it.
- Check the identity and permission that delivers or applies it.
- Check the destination, retention and quotas.
- Fix one link and test with a new sample.
Case 27. Log entries missing in Logs Explorer
Symptom. A service runs, but its entries are not found, or only some severities exist.
Cause. An exclusion filter on the _Default sink (or a user sink) matches the entries, or the log is routed only to another bucket, or the application writes to a different project.
gcloud logging sinks describe _Default --project=PROJECT_ID gcloud logging read 'resource.type="gce_instance" AND severity>=ERROR' --project=PROJECT_ID --freshness=1h --limit=3
Fix. Remove or narrow the exclusion (gcloud logging sinks update _Default --remove-exclusions=EXCLUSION_NAME; check --help for the flags). Entries that were excluded cannot be recovered.
Prevention. Manage exclusions in code with review, and never exclude audit logs.
Case 28. Sink exists but destination is empty
Symptom. The sink is listed, the filter matches entries in Logs Explorer, and the destination has nothing.
Cause. The sink writer identity has no permission on the destination, or the destination was deleted or is in another project without the right role.
gcloud logging sinks describe SINK_NAME --organization=ORG_ID --format="value(writerIdentity,destination)" gcloud storage buckets get-iam-policy gs://BUCKET_NAME --format="yaml(bindings)"
Fix. Grant the role to the writer identity, for example gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME --member="WRITER_IDENTITY" --role="roles/storage.objectCreator". For BigQuery use roles/bigquery.dataEditor; for Pub/Sub use roles/pubsub.publisher; for a log bucket use roles/logging.bucketWriter.
Prevention. Create the sink and the grant in one Terraform module and add a test entry in the pipeline.
Case 29. Organization sink misses child projects
Symptom. The central bucket has entries from the organization itself but none from projects.
Cause. The organization or folder sink was created without --include-children, so only entries of that resource (not its descendants) are routed.
gcloud logging sinks describe SINK_NAME --organization=ORG_ID --format="value(includeChildren,filter)"
Fix. Recreate or update the sink with --include-children (gcloud logging sinks update SINK_NAME --organization=ORG_ID --include-children; check the help for the flag form). Add the Data Access logs filter if required.
Prevention. Cover the flag in the module test: generate an audit event in a child project and look for it in the destination.
Case 30. No audit entries for reads
Symptom. You can see who created and deleted resources, but not who read data.
Cause. Data Access audit logs (DATA_READ, DATA_WRITE) are disabled by default for most services. Admin Activity logs are always on.
gcloud projects get-iam-policy PROJECT_ID --format="yaml(auditConfigs)" gcloud organizations get-iam-policy ORG_ID --format="yaml(auditConfigs)"
Fix. Enable the log types for the needed services in the project, folder or organization policy (the audit configuration is part of the IAM policy). Expect higher log volume and cost; scope it to sensitive services.
Prevention. Decide the Data Access logging standard per data class and enforce it in code.
Case 31. Alert policy fires but nobody is notified
Symptom. Incidents appear in Cloud Monitoring, but no email, chat or page arrives.
Cause. The notification channel is unverified, deleted, or not attached to the policy, or the recipient group does not accept external mail, or the policy is snoozed.
gcloud monitoring policies list --project=PROJECT_ID --format="table(displayName,enabled,notificationChannels.len())" gcloud alpha monitoring channels list --project=PROJECT_ID --format="table(displayName,type,enabled)"
Fix. Verify the channel, attach it to the policy, and send a test notification from the console. The alpha command group can change; check --help in your SDK version.
Prevention. Run a monthly synthetic alert test, and keep channels in Terraform.
Case 32. Sudden log ingestion cost
Symptom. The bill for Cloud Logging doubles with no new product launch.
Cause. A debug level was left on, VPC Flow Logs or load balancer logging uses full sampling, or Data Access logs were enabled broadly.
gcloud logging buckets describe _Default --location=global --project=PROJECT_ID gcloud logging read 'severity=DEBUG' --project=PROJECT_ID --freshness=1h --limit=5 --format="value(logName)"
Fix. Reduce the log level, lower flow log sampling, add an exclusion for noise (not for audit logs), and route bulk logs to a short-retention bucket. Use the logs-based metric logging.googleapis.com/billing/bytes_ingested in Metrics Explorer to find the top log names.
Prevention. Alert on daily ingestion bytes per project.
Case 33. Spend exceeded the budget
Symptom. Spend reached 140 percent of the budget and nothing was stopped; or the alert came a day late.
Cause. Budgets only notify. Cost data is delayed, so a fast-growing resource can pass the threshold before the alert arrives. Recipients may not include the right people.
gcloud billing budgets list --billing-account=BILLING_ACCOUNT_ID gcloud billing budgets describe BUDGET_ID --billing-account=BILLING_ACCOUNT_ID
Fix. Stop the resource now. Add lower thresholds (50, 80, 100 percent), a Pub/Sub topic, and a reviewed automation that, for sandboxes only, disables billing or scales down. Test it first.
Prevention. Treat budgets as alerts, use quotas and Organization Policy to limit what can be created, and review the daily cost dashboard.
Case 34. Billing export has missing days
Symptom. The BigQuery dataset has no data before a date, or the numbers differ from the invoice.
Cause. The export only contains data from the moment it was enabled; there is no backfill. Or the dataset location, permissions or project are wrong.
bq ls --project_id=PROJECT_ID BILLING_DATASET bq query --use_legacy_sql=false 'SELECT MIN(usage_start_time) FROM `PROJECT_ID.BILLING_DATASET.gcp_billing_export_v1_*`'
Fix. Use the console invoice for earlier periods, and enable the standard and detailed exports once, early. Keep one export per billing account.
Prevention. Enable billing export in the bootstrap layer. The query above is read-only; BigQuery may bill for the bytes scanned, usually small for this query.
Case 35. Terraform state lock error
Symptom. Error: Error acquiring the state lock ... Lock Info: ID: 1700000000000000.
Cause. Another run is active, or a cancelled job left a stale lock object in the state bucket.
gcloud storage ls gs://STATE_BUCKET/terraform/state/ gcloud storage cat gs://STATE_BUCKET/terraform/state/default.tflock
Fix. Confirm that no pipeline is running, then terraform force-unlock LOCK_ID. If a run is active, wait. The lock file name and path depend on the backend prefix.
Prevention. Use -lock-timeout, serialize runs per layer, and avoid cancelling apply jobs.
Case 36. Terraform 403 SERVICE_DISABLED
Symptom. Plan or apply fails with Error 403: ... API has not been used in project ... before or it is disabled.
Cause. The API is not enabled in the target project, or in the project that Terraform uses as the billing and quota project.
gcloud services list --enabled --project=PROJECT_ID --filter="config.name:SERVICE_NAME" grep -n "user_project_override\|billing_project" *.tf
Fix. Enable the API (free) with google_project_service and a dependency from the resources that need it. If the provider uses user_project_override, enable the API in the quota project too.
Prevention. The project factory enables the standard API set. Do not disable services on destroy unless intended.
Case 37. Plan changes after a provider upgrade
Symptom. No code change, but the plan shows many diffs or an error about a removed argument after terraform init -upgrade.
Cause. The Google provider version moved to a new major or minor release, or the lock file is not committed so each run picks a different version.
terraform version terraform providers git log -3 --stat -- .terraform.lock.hcl
Fix. Pin the version in required_providers (for example version = "~> 6.0"), commit .terraform.lock.hcl, read the upgrade guide, and upgrade in a branch with a plan review.
Prevention. Upgrade providers on a schedule with a dedicated pull request and a plan on every layer.
Case 38. Plan shows changes nobody made (drift)
Symptom. A scheduled plan reports changes, for example a firewall source range or a label that differs from code.
Cause. Someone changed the resource outside Terraform (console, script, another pipeline).
terraform plan -detailed-exitcode gcloud logging read 'protoPayload.methodName:"firewalls.patch" OR protoPayload.methodName:"firewalls.update"' --project=PROJECT_ID --freshness=7d --limit=5 --format="table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.resourceName)"
Fix. Decide per resource: revert by apply, or adopt the change in code. Talk to the person who changed it. Use terraform import for resources that were created outside Terraform.
Prevention. Remove standing write access in the console, require changes through pull requests, and run the drift plan daily.
Video links change often, so the links below are search pages rather than pinned video links. Check the date of a video against the documentation you use.
- YouTube search: Cloud Logging sinks and Log Router
- YouTube search: budgets, alerts and billing export
- YouTube search: Terraform state and drift detection on Google Cloud
Official reading: Routing and storage overview · Budgets and alerts · Terraform state.
Module 4 · Security, policy and compute cases
- Read Organization Policy and VPC Service Controls denials and name the constraint or perimeter that caused them.
- Diagnose 12 recurring security and compute cases with read-only commands, dry-run evidence and the audit log.
- Fix each case without weakening the guardrail, using an exception, a tag, an ingress rule or a correct role.
The short answer
Security guardrails exist to say "no" automatically. Cases 39 to 50 are the moments when the guardrail says "no" to something a team believes is valid, or when a guardrail's own dependency (a key, a secret, a role) breaks. The goal is to fix the request, not the guardrail, unless a reviewed exception is justified.
What: the layers that can say no
- Organization Policy: constraints on what resources may be created or configured (locations, external IPs, key creation, public access, domains).
- VPC Service Controls: perimeters around Google APIs and data; ingress and egress rules; access levels.
- IAM: roles for people and service accounts, including OS Login, Secret Manager access and Cloud KMS use.
- Keys and secrets: Cloud KMS keys for CMEK and Secret Manager for runtime secrets.
- Detection: Security Command Center findings and Cloud Asset Inventory.
- Compute defaults: default service accounts, metadata and quotas.
Why: fix the right layer
Most escalations in this area are applied at the wrong layer. People add roles when a constraint blocks them, or ask to turn off a constraint when only a location, a tag or an ingress rule needs a change. Reading the message and the audit log tells you which layer decided.
How it works: how a denial identifies itself
| Layer | What the error looks like | Where to read more |
|---|---|---|
| Organization Policy | Constraint constraints/... violated, FAILED_PRECONDITION | gcloud org-policies describe --effective |
| IAM allow or deny | Permission 'x' denied on resource | Policy Troubleshooter |
| VPC Service Controls | Request is prohibited by organization's policy, VPC_SERVICE_CONTROLS | Audit log VpcServiceControlAuditMetadata |
| CMEK | Cloud KMS key ... is disabled or permission denied on the key | gcloud kms keys versions list |
| Secrets | Permission denied on secret for the runtime identity | gcloud secrets get-iam-policy |
| Compute quota | Quota 'CPUS' exceeded | Quotas page, gcloud compute regions describe |
When to ask for an exception
Ask for one only when there is a documented business need, a narrow scope (one project or folder), an owner and an expiry. Prefer a tag-based exception or a policy on a specific folder to a change at the organization level.
What it is confused with
| Looks like | But it is | How to tell |
|---|---|---|
| IAM denial | Organization Policy denial | The text contains a constraints/ name |
| IAM denial | VPC Service Controls | The role is correct, the caller is outside the perimeter |
| Network block | VPC Service Controls | API call is denied while TCP connectivity works |
| Application bug | Disabled key version | Reads fail for all clients at the same time |
| Scanner noise | Real exposure | Check the resource, then mute by rule with a reason |
Three common misunderstandings
- "A perimeter is a firewall." It controls API access and data movement for Google services, not IP packets between VMs.
- "Disabling a key is a safe way to pause an app." It makes data unreadable for services that use it, and the effect can be sudden and widespread.
- "Muting a finding hides the risk." Muting by rule with a reason and a review date keeps the record while removing noise. Hiding without a reason removes accountability.
Figure 1. The layers that can deny a request, and the cases found at each. A denial message usually tells you which layer decided.
Figure 2. A perimeter blocks calls that cross the boundary unless an ingress or egress rule, or an access level, allows them (Case 40). Test new rules in dry-run mode first.
The animation shows an Organization Policy denial for an external IP (Case 44): which component evaluates the constraint, what the caller sees and what the audit log records. The retry without an external IP shows the right way to proceed.
Use these to find the guardrail that said no. Write commands are marked and say whether they cost money. Check gcloud ... --help for the flags in your SDK version.
gcloud org-policies list and describe --effective
Purpose. Lists the policies set on a resource and shows the effective policy after inheritance.
gcloud org-policies list --project=PROJECT_ID gcloud org-policies describe gcp.resourceLocations --project=PROJECT_ID --effective
name: projects/PROJECT_ID/policies/gcp.resourceLocations
spec:
rules:
- values:
allowedValues:
- in:eu-locations
Common errors. A list constraint can use value groups such as in:eu-locations. Read the group definition in the documentation before you change it. Free.
gcloud logging read for VPC Service Controls
Purpose. Finds violation entries with the perimeter, service and caller.
gcloud logging read 'protoPayload.metadata.@type="type.googleapis.com/google.cloud.audit.VpcServiceControlAuditMetadata"' \ --project=PROJECT_ID --freshness=1d --limit=3 \ --format="yaml(protoPayload.authenticationInfo.principalEmail,protoPayload.serviceName,protoPayload.metadata.violationReason,protoPayload.metadata.securityPolicyInfo)"
Common errors. The entry may appear in the project that owns the protected resource, or in the organization. Query the audit log of the protected project and of the organization. Free.
gcloud access-context-manager perimeters list
Purpose. Lists service perimeters of an access policy, with the protected projects and services.
gcloud access-context-manager perimeters list --policy=ACCESS_POLICY_ID gcloud access-context-manager perimeters describe PERIMETER_NAME --policy=ACCESS_POLICY_ID
Flags. --policy is the numeric access policy ID of the organization. Dry-run configurations are under the dry-run subcommand group; check gcloud access-context-manager perimeters dry-run --help for the flags in your SDK version. Free.
gcloud kms keys versions list and enable
Purpose. Shows the state of key versions (ENABLED, DISABLED, DESTROY_SCHEDULED, DESTROYED). Enable restores a disabled version.
gcloud kms keys versions list --key=KEY_NAME --keyring=KEYRING_NAME --location=REGION --project=PROJECT_ID gcloud kms keys versions enable 1 --key=KEY_NAME --keyring=KEYRING_NAME --location=REGION --project=PROJECT_ID
NAME STATE projects/PROJECT_ID/locations/REGION/keyRings/KEYRING_NAME/cryptoKeys/KEY_NAME/cryptoKeyVersions/1 DISABLED
Cost. Listing is free. Enabling a key version restores use of a billed key version; key versions are metered per active version. A DESTROYED version cannot be restored.
gcloud secrets get-iam-policy
Purpose. Shows who may access a secret, and the access at version level.
gcloud secrets get-iam-policy SECRET_NAME --project=PROJECT_ID gcloud secrets versions list SECRET_NAME --project=PROJECT_ID
Common errors. roles/secretmanager.secretAccessor is needed to read the value; roles/secretmanager.viewer does not read the payload. Do not print secret values in logs or tickets. Free to read.
gcloud compute instances describe for metadata and service account
Purpose. Shows which service account, scopes and metadata (including OS Login) a VM uses.
gcloud compute instances describe VM_NAME --zone=ZONE --project=PROJECT_ID \ --format="yaml(serviceAccounts,metadata.items)"
Common errors. The default Compute Engine service account may hold no roles if the landing zone enforces iam.automaticIamGrantsForDefaultServiceAccounts. Free.
Lab: reproduce Case 44 and Case 41 safely (about 15 minutes, no or very low cost)
Goal. See an Organization Policy deny an external IP address (Case 44) and a disabled key version make a key unusable (Case 41), without creating anything that runs. IDs in the expected output are illustrative.
Prerequisites. A sandbox folder and project in an organization, roles/orgpolicy.policyAdmin on the sandbox folder only, roles/compute.instanceAdmin.v1 on the project, roles/cloudkms.admin on the project, and a budget set first. Do not use production folders.
- Check the current state:
gcloud org-policies describe compute.vmExternalIpAccess --project=PROJECT_ID --effective. Record it so you can restore it. - Set a deny-all policy on the sandbox folder with a YAML file named
policy.yaml:name: folders/FOLDER_ID/policies/compute.vmExternalIpAccess spec: rules: - denyAll: true
gcloud org-policies set-policy policy.yaml
- Try to create a VM with an external IP. The request is denied, so nothing is created and nothing is billed:
gcloud compute instances create lab-denied --zone=ZONE --machine-type=e2-micro --project=PROJECT_ID
- Read the denial in the audit log with the command from the Commands tab, and note the constraint name and the principal.
- Case 41: create a key ring and key (metered, low cost), then disable the version and read its state:
gcloud kms keyrings create lab-ring --location=REGION --project=PROJECT_ID gcloud kms keys create lab-key --keyring=lab-ring --location=REGION --purpose=encryption --project=PROJECT_ID gcloud kms keys versions disable 1 --key=lab-key --keyring=lab-ring --location=REGION --project=PROJECT_ID gcloud kms keys versions list --key=lab-key --keyring=lab-ring --location=REGION --project=PROJECT_ID
- Enable the version again and list it: it must show
ENABLED.
ERROR: (gcloud.compute.instances.create) Could not fetch resource: - Constraint constraints/compute.vmExternalIpAccess violated for project PROJECT_ID. Add instance projects/PROJECT_ID/zones/ZONE/instances/lab-denied to the constraint to use external IP with it.
Expected result. The VM creation is denied with the constraint name, and the key version moves between DISABLED and ENABLED.
Cost. No compute cost because creation is denied. The key is a small metered resource (low). Budgets send alerts and do not cap spend.
Cleanup. Restore the policy: delete the folder policy with gcloud org-policies delete compute.vmExternalIpAccess --folder=FOLDER_ID (it falls back to the inherited policy). Schedule the key version for destruction (gcloud kms keys versions destroy 1 --key=lab-key --keyring=lab-ring --location=REGION) only for lab keys. Key rings cannot be deleted; keep it empty and note it.
Real cases
- Region rule meets a managed service. A new managed service stored metadata in a multi-region outside the allowed list. The team asked for a global exception. A reviewed change added only the required location group to one folder instead.
- Pipeline inside a perimeter. A Cloud Build pipeline lived outside a perimeter and read buckets inside it. Dry-run logs listed every call, and a narrow ingress rule for the build service account replaced a wide access level.
- Key rotation scare. A cleanup script disabled old key versions that were still in use by a database. Reads failed in minutes. A rule that requires a two-person review for KMS state changes and an alert on
DisableCryptoKeyVersionwere added.
Practices
- Constraints at the organization with exceptions at folder level, owned by the platform team and documented in code.
- Perimeters first in dry-run for a full cycle of the business, then enforce; ingress and egress rules per service account.
- Separate key administration from key use: the platform team manages keys, the service agent uses them.
- Secrets in Secret Manager with per-secret access, rotation and no payload in logs.
- Mute findings by rule with a reason and a review date; assign owners per category.
Case index
| Case | Symptom in one line | First check |
|---|---|---|
| 39 | Deployment blocked by gcp.resourceLocations | Effective allowed locations |
| 40 | Pipeline blocked by VPC Service Controls | Violation entry in the audit log |
| 41 | Resource unusable after a key change | State of the KMS key version |
| 42 | Thousands of noisy SCC findings | Finding categories and severity |
| 43 | Cannot add an external user to IAM | iam.allowedPolicyMemberDomains |
| 44 | VM with external IP denied | compute.vmExternalIpAccess |
| 45 | SSH fails with OS Login required | OS Login roles and metadata |
| 46 | Bucket creation denied | Uniform access and public access prevention |
| 47 | Cloud SQL with public IP denied | sql.restrictPublicIp |
| 48 | Runtime cannot read a secret | Secret IAM for the runtime identity |
| 49 | Nodes or VMs fail with the default service account | Roles of the default service account |
| 50 | Org policy change has no effect | Inheritance and merge settings |
Triage order
- Read the exact error text and look for
constraints/, a permission name or a VPC Service Controls hint. - Run the effective policy or Policy Troubleshooter for that layer.
- Find the audit entry that records the denial.
- Choose the smallest fix: change the request, add a narrow exception, or fix a role.
- Re-test, then record the exception or the change in code.
Case 39. Deployment blocked by gcp.resourceLocations
Symptom. Location us-east1 violates constraint constraints/gcp.resourceLocations when creating a bucket, dataset or disk.
Cause. The effective policy allows only certain locations (for example in:eu-locations). The deployment used a default region or a multi-region outside the list.
gcloud org-policies describe gcp.resourceLocations --project=PROJECT_ID --effective gcloud config get-value compute/region
Fix. Deploy to an allowed location. If the business needs another location, request a reviewed change on the narrowest folder. Set the region explicitly in code.
Prevention. Put the allowed regions in a shared Terraform variable and fail validation on others.
Case 40. Pipeline blocked by VPC Service Controls
Symptom. Request is prohibited by organization's policy with vpcServiceControlsUniqueIdentifier from Cloud Build, BigQuery or Cloud Storage.
Cause. The caller is outside the perimeter and no ingress rule or access level allows it, or the resource inside needs an egress rule to reach another project.
gcloud logging read 'protoPayload.metadata.@type="type.googleapis.com/google.cloud.audit.VpcServiceControlAuditMetadata"' --project=PROJECT_ID --freshness=1h --limit=3 gcloud access-context-manager perimeters describe PERIMETER_NAME --policy=ACCESS_POLICY_ID
Fix. Add an ingress rule for the specific identity, source and service, test it in dry-run mode, then enforce. Do not add the whole organization to an access level.
Prevention. Run every new perimeter in dry-run for a full business cycle and review the violations weekly.
Case 41. Resource unusable after a key change
Symptom. A database or disk fails with Cloud KMS key ... is disabled or Permission denied on Cloud KMS key.
Cause. The CMEK key version was disabled or destroyed, or the service agent lost roles/cloudkms.cryptoKeyEncrypterDecrypter on the key.
gcloud kms keys versions list --key=KEY_NAME --keyring=KEYRING_NAME --location=REGION --project=PROJECT_ID gcloud kms keys get-iam-policy KEY_NAME --keyring=KEYRING_NAME --location=REGION --project=PROJECT_ID
Fix. Enable the version if it is only disabled, or restore the role for the service agent. A version in DESTROY_SCHEDULED can be restored before the destroy time; a DESTROYED version cannot.
Prevention. Alert on key state changes, use a longer destroy schedule, and separate key administration from key use.
Case 42. Thousands of noisy SCC findings
Symptom. After enabling Security Command Center, the console shows thousands of findings and the team ignores the page.
Cause. Initial scans report every existing issue, and the same category repeats for many resources (for example open ports on lab projects).
gcloud scc findings list ORG_ID --filter='state="ACTIVE" AND severity="HIGH"' --format="table(category,resourceName)" --limit=20 gcloud scc findings group ORG_ID --group-by=category --filter='state="ACTIVE"'
Fix. Group by category, fix the high severity set first, and create mute rules with a reason for accepted cases. The gcloud scc flags depend on the SDK version and tier; check gcloud scc findings --help.
Prevention. Define owners per category, a due date per severity, and a weekly review. Export findings to a ticket tool by Pub/Sub.
Case 43. Cannot add an external user to IAM
Symptom. Adding user:name@partner.com fails with One or more users named in the policy do not belong to a permitted customer.
Cause. constraints/iam.allowedPolicyMemberDomains allows only identities of the listed Cloud Identity customers.
gcloud org-policies describe iam.allowedPolicyMemberDomains --project=PROJECT_ID --effective gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:partner.com"
Fix. Prefer a federated group or a guest identity in your own domain. If an external domain is required, add the customer ID to the allowed list on the narrowest folder, with an expiry and an owner.
Prevention. Publish the exception process, and review domain exceptions quarterly.
Case 44. VM with external IP denied
Symptom. Constraint constraints/compute.vmExternalIpAccess violated when creating an instance or a GKE node pool.
Cause. The policy denies external IPs for all or most instances, by design.
gcloud org-policies describe compute.vmExternalIpAccess --project=PROJECT_ID --effective gcloud compute instances create VM_NAME --zone=ZONE --no-address
Fix. Create the instance with --no-address and use Cloud NAT for egress, a load balancer for ingress, and IAP for admin access. Add a named instance to the allowed list only if the exception is approved.
Prevention. Make private instances the default in modules and document the three access patterns.
Case 45. SSH fails with OS Login required
Symptom. Permission denied (publickey) or Could not add SSH key to OS Login.
Cause. constraints/compute.requireOsLogin is enforced, so the user needs an OS Login role and the VM must have OS Login enabled. The IAP tunnel role is separate.
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:USER_EMAIL AND bindings.role:osLogin" --format="table(bindings.role)" gcloud compute instances describe VM_NAME --zone=ZONE --format="value(metadata.items)"
Fix. Grant roles/compute.osLogin (or roles/compute.osAdminLogin for sudo) through a group, and roles/iam.serviceAccountUser on the VM service account where needed. Retry with gcloud compute ssh VM_NAME --zone=ZONE --tunnel-through-iap.
Prevention. Standard group-to-role bindings per environment, with admin access time-limited.
Case 46. Bucket creation denied
Symptom. Constraint constraints/storage.uniformBucketLevelAccess violated or a message about public access prevention.
Cause. The organization enforces uniform bucket-level access, and sometimes public access prevention. The create command or Terraform did not set them.
gcloud org-policies describe storage.uniformBucketLevelAccess --project=PROJECT_ID --effective gcloud org-policies describe storage.publicAccessPrevention --project=PROJECT_ID --effective
Fix. Create the bucket with gcloud storage buckets create gs://BUCKET_NAME --location=REGION --uniform-bucket-level-access --public-access-prevention (a bucket is metered by use). In Terraform set uniform_bucket_level_access = true and public_access_prevention = "enforced".
Prevention. Put the secure settings in the shared bucket module.
Case 47. Cloud SQL with public IP denied
Symptom. Creating an instance fails with Constraint constraints/sql.restrictPublicIp violated.
Cause. The policy forbids public IPv4 on Cloud SQL instances. The configuration enables a public IP by default.
gcloud org-policies describe sql.restrictPublicIp --project=PROJECT_ID --effective gcloud sql instances describe INSTANCE_NAME --project=PROJECT_ID --format="yaml(ipAddresses,settings.ipConfiguration)"
Fix. Use private IP with a private services access connection or Private Service Connect, and set --no-assign-ip on creation. Check gcloud sql instances create --help for the flags in your SDK version.
Prevention. The database module sets private networking and fails if a public IP is requested.
Case 48. Runtime cannot read a secret
Symptom. The application starts, then fails with Permission 'secretmanager.versions.access' denied.
Cause. The runtime service account (Cloud Run, GKE workload, VM) has no roles/secretmanager.secretAccessor on the secret, or the secret version is disabled or in another project.
gcloud secrets get-iam-policy SECRET_NAME --project=PROJECT_ID gcloud secrets versions list SECRET_NAME --project=PROJECT_ID --format="table(name,state)"
Fix. Grant roles/secretmanager.secretAccessor on that secret to the runtime service account (not on the project), and enable the version. For users, use impersonation instead of reading the value.
Prevention. Bind the access in the same module that creates the secret and the workload.
Case 49. Nodes or VMs fail with the default service account
Symptom. GKE nodes cannot pull images or write logs; a VM cannot write to Cloud Logging, after a new project was created.
Cause. The landing zone enforces constraints/iam.automaticIamGrantsForDefaultServiceAccounts, so the default Compute Engine service account receives no roles when created. The workload still uses it.
gcloud org-policies describe iam.automaticIamGrantsForDefaultServiceAccounts --project=PROJECT_ID --effective gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:PROJECT_NUMBER-compute@developer.gserviceaccount.com" --format="table(bindings.role)"
Fix. Create a dedicated service account with only the roles the workload needs (for example roles/logging.logWriter, roles/artifactregistry.reader) and attach it. Do not grant Editor to the default account.
Prevention. Modules always set an explicit service account.
Case 50. Organization policy change has no effect
Symptom. A new constraint or exception was applied, but resources are still allowed or still blocked.
Cause. The policy at a lower level overrides or merges differently than expected (inheritFromParent, reset), the change is on another resource, or a tag-conditional rule does not match.
gcloud org-policies describe CONSTRAINT_NAME --folder=FOLDER_ID gcloud org-policies describe CONSTRAINT_NAME --project=PROJECT_ID --effective
Fix. Compare the policy at each level with the effective result and set inheritFromParent consistently. Wait a short time for propagation, then retest with a new create request.
Prevention. Keep all policies in code with a plan per folder, and add a test that creates a denied resource in a sandbox.
Video links change often, so the links below are search pages rather than pinned video links. Check the date of a video against the documentation you use.
- YouTube search: Organization Policy constraints and troubleshooting
- YouTube search: VPC Service Controls dry-run, ingress and egress rules
- YouTube search: Cloud KMS, CMEK and Secret Manager
Official reading: Organization Policy overview · Troubleshooting VPC Service Controls · Cloud KMS key states.
Module 5 · Interview questions on landing-zone design
- Answer a landing-zone design question in four moves: short answer, reasoning, a Google Cloud example and a pitfall.
- Explain hierarchy, project granularity, environment separation, bootstrap and billing decisions as trade-offs, not as rules.
- Draw the hierarchy and the layered pipeline on a whiteboard in under five minutes.
The short answer
An interview about a landing zone (着陆区) is not a test of how many product names you remember. It tests whether you can make a decision, defend it, and name what it costs. Every strong answer follows four moves. Short answer: one sentence a manager could repeat. Reasoning: why, in terms of risk, cost or speed. Google Cloud example: a real service, constraint or command. Pitfall: what goes wrong if it is done badly.
What: the framework for landing-zone questions
| Move | What the interviewer hears | Example for "How do you separate environments?" |
|---|---|---|
| 1. Short answer | You can summarise | "Separate folders and projects per environment." |
| 2. Reasoning | You know why | "Policy and IAM are inherited, so a folder is the cheapest place to apply a stricter rule." |
| 3. Example | You have used it | "A prod folder with gcp.resourceLocations and fewer editors." |
| 4. Pitfall | You have seen it fail | "Moving a project between folders changes inherited policy immediately." |
Why this matters
Landing-zone roles (cloud platform engineer, cloud architect, SRE for the platform) are hired for judgement. Two candidates can both list Shared VPC, Organization Policy and Terraform. The one who says "I would not start with eleven folders; I would start with three and split when a team needs a different policy" shows experience. Keep each answer to about a minute and a half, so the interviewer can steer.
How the thirteen questions in this module are grouped
- Purpose and comparison (Q1, Q13): what a landing zone is, and how it compares with AWS Control Tower and Azure landing zones.
- Hierarchy and boundaries (Q2, Q3, Q4): folder design, project granularity, environment separation.
- Control model (Q5, Q6, Q12): policy versus IAM, central versus delegated, how you know it works.
- Build and run (Q7, Q8): stages, bootstrap.
- Housekeeping that decides success (Q9, Q10, Q11): naming, billing, regions.
When the question is open-ended
If you hear "design a landing zone for us", do not start with services. Ask four questions first: how many teams and environments, which compliance regimes, is there an existing organization or only loose projects, and does it connect to on-premises. Then give the layers from the blueprint: identity, hierarchy, policy, network, logging, cost, automation.
Confused with
| Often confused | Difference to state |
|---|---|
| Landing zone vs blueprint | A blueprint is a reference design (for example the enterprise foundations guide); the landing zone is your implemented, governed environment. |
| Guardrail vs gate | A guardrail prevents or detects automatically and lets people continue; a gate is a manual approval that waits for a person. |
| Folder vs project | Folders group and inherit policy; projects hold resources, APIs, quota and a billing link. |
Common misunderstandings
- "There is one correct hierarchy." There are patterns (by environment, by business unit, hybrid). The right answer depends on who needs different policies.
- "Guardrails slow teams down." Badly designed gates do. Preventive policy that is documented and automated removes review queues.
- "Interviewers want the longest answer." They want a structured answer they can interrupt.
Self-test before the interview
Pick any three questions, set a timer for 90 seconds each and answer aloud without notes. Record yourself once. The usual faults are no pitfall, no real service name, and starting with history instead of the short answer.
Figure 1. The hierarchy you can draw in two minutes. Practise saying why each folder exists, not only what it is called.
Figure 2. The staged pipeline. Be ready to say who owns each stage and which identity runs it.
The animation follows one request through the layers an interviewer expects you to know: a pipeline creates a project, the hierarchy applies inherited policy and IAM, billing is linked, and a violating request is denied. Use it as a script when you explain inheritance out loud.
An interviewer will not ask you to recite flags, but they expect you to know the read-only commands that prove a design claim. Run them in Cloud Shell on a lab organization. Placeholders are in capitals.
gcloud organizations get-iam-policy
Purpose. Shows who holds roles at the organization. It answers "who can change policy for the whole company?".
gcloud organizations get-iam-policy ORG_ID --format="table(bindings.role,bindings.members.flatten())"
ROLE MEMBERS roles/resourcemanager.organizationAdmin group:gcp-org-admins@example.com roles/billing.creator group:gcp-billing-admins@example.com
Flags. --format selects the output shape; bindings.members.flatten() prints one line per member. Output above is illustrative.
Common errors. PERMISSION_DENIED means you lack resourcemanager.organizations.getIamPolicy. Production use: review this list regularly; it should contain groups only. Cost: free.
gcloud resource-manager folders list
Purpose. Confirms the folder layout you described on the whiteboard.
gcloud resource-manager folders list --organization=ORG_ID
DISPLAY_NAME PARENT_NAME ID platform organizations/ORG_ID 111111111111 prod organizations/ORG_ID 222222222222 nonprod organizations/ORG_ID 333333333333
Flags. --organization lists the top level; use --folder=FOLDER_ID for children. Common errors. An empty list means no folders or no resourcemanager.folders.list. Production use: compare with the Terraform configuration to spot folders created by hand. Cost: free.
gcloud org-policies list and describe --effective
Purpose. Lists the constraints set on a resource, and shows the effective result after inheritance. This is the command behind "show me how production is restricted".
gcloud org-policies list --folder=FOLDER_ID gcloud org-policies describe gcp.resourceLocations --folder=FOLDER_ID --effective
CONSTRAINT LIST_POLICY BOOLEAN_POLICY ETAG constraints/gcp.resourceLocations SET - CJ6Vh68GEJDr
Flags. --effective merges inherited policies. Check gcloud org-policies describe --help for the flags in your SDK version. Common errors. NOT_FOUND when the constraint is not set at that level; use --effective to see inherited values. Production use: attach this output to audit evidence. Cost: free.
gcloud projects describe
Purpose. Proves where a project sits and which labels it carries, so you can talk about inheritance and cost allocation with facts.
gcloud projects describe PROJECT_ID --format="yaml(projectId,parent,labels)"
labels: cost-center: cc-1042 env: prod parent: id: '222222222222' type: folder projectId: prj-shop-prod-1a2b
Flags. --format="yaml(...)" projects only the named fields. Common errors. Could not find project or no permission. Production use: a scheduled report of projects without labels. Cost: free.
gcloud billing projects describe
Purpose. Shows which billing account pays for a project and whether billing is enabled.
gcloud billing projects describe PROJECT_ID
billingAccountName: billingAccounts/0X0X0X-0X0X0X-0X0X0X billingEnabled: true name: projects/prj-shop-prod-1a2b/billingInfo projectId: prj-shop-prod-1a2b
Common errors. billingEnabled: false explains many "API not enabled" or "cannot create VM" failures. Production use: part of the project-factory verification. Cost: free.
gcloud asset search-all-resources
Purpose. Searches resources across the organization. Useful to answer "do we have any resource outside the allowed region?" in an interview scenario.
gcloud asset search-all-resources --scope=organizations/ORG_ID --asset-types=compute.googleapis.com/Instance --format="table(name,location)"
Common errors. The Cloud Asset API must be enabled on the project used for the request. Check gcloud asset search-all-resources --help for the flags in your SDK version. Cost: free for the search itself. Production use: drift and inventory reports.
Lab: the whiteboard drill and the evidence drill (about 20 minutes, no cost)
Goal. Be able to draw and defend a landing-zone design aloud, and to back each claim with a read-only command. IDs in the expected output are illustrative.
Prerequisites. A sandbox organization or project where you have read access, Cloud Shell, a timer, paper or a whiteboard. No real secrets are needed. Write no resources in this lab.
- Draw (5 minutes). On paper draw the organization, four folders (
platform,prod,nonprod,sandbox), two projects per environment and the billing account. Mark where Organization Policy, the log sink and the budget live. - Verify the facts (5 minutes). For your real sandbox, run
gcloud organizations list,gcloud resource-manager folders list --organization=ORG_IDandgcloud projects describe PROJECT_ID --format="value(parent)". Note one difference between your drawing and reality. - Explain (6 minutes). Pick Q2, Q4 and Q10 from this module. Answer each in 90 seconds with all four moves. Record the audio on your phone.
- Review (4 minutes). Replay the recording. Count missing moves (short answer, reasoning, example, pitfall). Write down one sentence to add to each answer.
Verification. You pass when each answer has all four moves, names at least one real service or constraint, and is under two minutes.
parent: id: '222222222222' type: folder
Cost. Free. All commands are read-only.
Cleanup. None. Keep the drawing for the module 8 mock interview.
Extension: defend a decision you disagree with
Ask a colleague to take the opposite view on Q3 (one project per application versus a shared project per team). Write the two strongest arguments for each side. A candidate who can argue both sides gives better trade-off answers.
Real cases behind the questions
- Deep folder tree after a re-org. A company mirrored its management layers in nine folder levels. After a re-organisation, teams moved projects between folders and unexpectedly inherited different policies. The fix was a flat structure by policy (platform, production, non-production, sandbox) and a rule that moves go through the platform repository.
- Hand-made projects. Teams requested projects by ticket and set labels by hand. Cost reports had a third of the spend unlabeled. A Terraform project factory with mandatory labels, a billing link and a default budget removed the gap and cut request time from days to minutes.
- One state file for everything. A single Terraform state held organization, network and project resources. A routine plan took long, and one mistaken destroy showed folders in the plan. Splitting into stages with separate service accounts made reviews short and reduced the impact of one error.
Practices
- Keep an architecture decision record for each hierarchy, network and billing decision. Interviewers and auditors both ask "why".
- Review the organization IAM policy and the list of folders monthly against the code.
- Rehearse questions with someone who will interrupt you; real interviews do.
prj-shop-prod.Thirteen questions (Q1 to Q13) with model answers, then a quick index and a triage order for when your answer stalls.
Model answers Q1 to Q13
Q1 What is a landing zone, and why would a company build one?
Short answer. It is the governed foundation that every workload inherits: identity, hierarchy, policy, network, logging and cost controls.
Reasoning. Without it each team rebuilds controls differently, so security and cost depend on memory. With it the safe setup is the default and audits become checks, not projects.
Example. New projects are created by a Terraform project factory under a folder that already has Organization Policy, group bindings, a log sink and a budget.
Pitfall. Treating it as a one-off project. A landing zone is a product with owners, a backlog and releases.
Q2 How do you design the folder structure?
Short answer. Start small and mirror policy differences, not the org chart.
Reasoning. Folders exist to inherit IAM and Organization Policy. If two groups need the same rules, they share a folder. Re-orgs change charts often but rarely change policy.
Example. Top-level folders platform, prod, nonprod and sandbox; business-unit folders only below them when needed.
Pitfall. Deep trees that mirror management layers. They are hard to change, and moving a project silently changes the policies it inherits.
Q3 One project per application, or shared projects?
Short answer. One project per application per environment, with shared services in dedicated projects.
Reasoning. The project is the boundary for IAM, quota, APIs and cost. Small projects limit blast radius and make cost allocation obvious.
Example. prj-shop-prod and prj-shop-dev as service projects attached to a Shared VPC host project.
Pitfall. Thousands of hand-made projects. Without a project factory and quota monitoring the approach collapses under its own admin load.
Q4 How do you separate production from non-production?
Short answer. Separate folders and projects, with stricter policy on the production folder.
Reasoning. Inheritance makes the folder the cheapest enforcement point. Developers get editor-like access in non-production and read-only or break-glass access in production.
Example. Production folder: allowed regions, no external IPs, deployments only by a CI service account; non-production: relaxed budgets and shorter log retention.
Pitfall. Sharing one VPC or one service account across environments, which re-creates the boundary you removed.
Q5 What is the difference between IAM and Organization Policy?
Short answer. IAM controls who may act; Organization Policy controls what may be configured.
Reasoning. Both are inherited, but they answer different questions. A fully trusted administrator can still be blocked from creating a resource in a forbidden region.
Example. constraints/compute.vmExternalIpAccess denies external IPs even for project owners; IAM then grants roles/compute.admin to a group.
Pitfall. Using IAM alone for guardrails. Someone with permission will eventually do the forbidden thing.
Q6 Centralised control or delegated autonomy for application teams?
Short answer. Central guardrails, delegated freedom inside them.
Reasoning. The platform team owns policy, network, logging and billing structure. Application teams own their workloads and may create resources within the guardrails, which keeps lead time short.
Example. Teams get roles/editor-like custom roles in non-production, while the network and the org policies are changed only through the platform repository.
Pitfall. A ticket-based gate for every change. Teams then bypass it, and shadow projects appear.
Q7 Why split Terraform into stages, and what are they?
Short answer. Stages are bootstrap, organization, environments, networks and projects, each with its own state and service account.
Reasoning. Smaller state files plan faster and fail smaller. Different stages have different owners, so the identity that creates projects cannot also edit organization policy.
Example. The networks stage identity holds roles/compute.networkAdmin on the network folder only.
Pitfall. One giant state and one all-powerful service account. A single bad apply or leaked token affects everything.
Q8 What is the bootstrap problem and how do you solve it?
Short answer. Automation needs an identity and a state bucket before it can exist, so the first layer is created once under human control.
Reasoning. The seed project, state bucket and automation service accounts are created by a small, reviewed script or run, then handed to Terraform and locked down.
Example. gcloud storage buckets create with versioning, then terraform init -migrate-state to move the bootstrap state into the bucket.
Pitfall. Leaving the bootstrap admin account in daily use. Remove standing access afterwards.
Q9 How do you handle naming, labels and tags?
Short answer. Predictable names, labels for cost, tags for policy.
Reasoning. Project IDs are global and cannot be changed, so naming must be decided first. Labels flow into billing export for allocation. Resource Manager tags can drive IAM conditions and policy.
Example. prj-shop-prod-1a2b with labels cost-center, env and owner.
Pitfall. Optional labels. Enforce them in the project factory or the allocation report will have gaps.
Q10 How would you structure billing accounts?
Short answer. As few billing accounts as finance accepts, with budgets and labels for the detail.
Reasoning. Billing is a payment and reporting structure, not a security boundary. Separate accounts help when entities invoice separately; otherwise export and labels give the same visibility.
Example. One account per legal entity, billing export to BigQuery, a budget per folder or project with alerts at several thresholds.
Pitfall. Believing a budget caps spending. It sends alerts; stopping spend needs automation you build.
Q11 How do you decide regions and data residency?
Short answer. Start from legal and latency requirements, then enforce them with policy.
Reasoning. Choosing a region is cheap early and costly later, because data and addresses are hard to move. Enforcement should be automatic, not a convention.
Example. constraints/gcp.resourceLocations with a value group such as in:eu-locations on the production folder; Assured Workloads for regulated regimes.
Pitfall. Forgetting that some global services and logs have their own location settings.
Q12 How do you know a landing zone is working?
Short answer. By measuring lead time, policy violations and drift, not by counting resources.
Reasoning. A working platform lets a team get a compliant project quickly and makes unsafe actions fail early. You also need evidence: audit logs, asset inventory and findings that trend down.
Example. Time from request to usable project, number of denied policy events, number of non-compliant findings in Security Command Center, drift detected by a scheduled plan.
Pitfall. Vanity metrics such as project count, which say nothing about safety.
Q13 How does a Google Cloud landing zone compare with AWS Control Tower or Azure landing zones?
Short answer. The ideas map one to one, but Google Cloud has no single packaged service; it is assembled from the blueprint and your own code.
Reasoning. Organization, folder and project correspond to organization, OU and account, or to root management group, management group and subscription. Organization Policy plays the role of service control policies or Azure Policy.
Example. The enterprise foundations blueprint provides Terraform stages that you adapt.
Pitfall. Assuming a button exists. You own the code and its upgrades.
Question index
| No. | Topic | One-line answer key |
|---|---|---|
| Q1 | Purpose | Governed foundation every workload inherits |
| Q2 | Folders | Mirror policy differences, start small |
| Q3 | Project granularity | Per application per environment, automated |
| Q4 | Prod versus non-prod | Separate folders and projects, stricter prod folder |
| Q5 | IAM versus Org Policy | Who may act versus what may be configured |
| Q6 | Central versus delegated | Central guardrails, delegated freedom |
| Q7 | Terraform stages | Own state and identity per stage |
| Q8 | Bootstrap | One controlled manual step, then code |
| Q9 | Naming and labels | Names fixed early, labels for cost, tags for policy |
| Q10 | Billing | Few accounts, budgets alert but do not cap |
| Q11 | Regions | Requirements first, enforce with location policy |
| Q12 | Success measures | Lead time, violations, drift |
| Q13 | Cloud comparison | Same ideas, assembled from blueprint and code |
When your answer stalls: triage order
- Restate the question in one sentence. It buys time and checks you understood.
- Give the short answer first, even if you are unsure of the details.
- Name the layer: identity, hierarchy, policy, network, logging, cost or automation.
- Offer one real command or constraint that would prove it.
- If you do not know a detail, say how you would check it ("I would confirm in the documentation and test in a sandbox").
Common faults
| Symptom in your answer | Likely cause | First fix |
|---|---|---|
| Answer runs past three minutes | History before the short answer | Lead with one sentence, then stop and offer detail |
| Only product names, no reasoning | Memorised lists | Add "because" for each choice |
| Interviewer keeps asking "what could go wrong?" | No pitfall in the answer | End every answer with one pitfall |
| Contradiction between answers | No shared mental model | Use the layer list and the hierarchy drawing as the base |
| Cannot recall a flag | Over-reliance on memory | Say the documented form and "check --help" |
Video links are search pages, not pinned videos, because titles and versions change. Check the date against the documentation you use.
- YouTube search: Google Cloud landing zone design
- YouTube search: enterprise foundations blueprint with Terraform
- YouTube search: resource hierarchy best practices
Official reading: Landing zone design in Google Cloud · Security foundations guide · Resource hierarchy.
Module 6 · Interview questions on identity, networking and security
- Answer identity questions about service accounts, keyless authentication, groups, conditions and deny policies with a concrete Google Cloud example.
- Explain Shared VPC, hierarchical firewall policies, private access and hybrid connectivity as design decisions with trade-offs.
- Distinguish IAM, Organization Policy, VPC Service Controls and encryption controls, and say which risk each one addresses.
The short answer
Identity, network and security questions all test one idea: defence in depth with clear owners. IAM decides who may call an API. Organization Policy limits what can be configured. The network and firewall policies limit what can talk to what. VPC Service Controls limits where data may flow. Encryption keys limit who can read stored data. A good answer names which layer addresses which risk, and does not claim that one layer does everything.
What: the five control layers an interviewer expects you to separate
| Layer | Question it answers | Google Cloud building block | Typical wrong claim |
|---|---|---|---|
| IAM | Who may call which API on which resource? | Allow policies, deny policies, conditions | "IAM stops data leaving the company." |
| Organization Policy | What may be configured at all? | Constraints on org, folder, project | "It grants access." |
| Network | Which paths exist and which are open? | Shared VPC, firewall policies, Cloud NAT, private access | "A private subnet makes the data safe." |
| VPC Service Controls | Where may API calls come from and data go? | Perimeters, access levels, ingress and egress rules | "It replaces firewalls." |
| Keys and secrets | Who can read stored data and credentials? | Cloud KMS, CMEK, Secret Manager | "Encryption means no access control is needed." |
Why this matters
Breaches usually pass through more than one weak layer: a leaked key (identity), an over-broad role (IAM), an open firewall (network), and a bucket that allowed public access (policy). Interviewers want to hear that you know which layer would have stopped each step, and which controls are detective rather than preventive.
How the questions are grouped
- Identity (Q14 to Q17): service account keys, Workload Identity Federation, groups and least privilege, deny and conditions.
- Network (Q18 to Q20, Q24): Shared VPC versus peering, hierarchical firewall policies, egress and private access, hybrid connectivity.
- Data protection (Q21 to Q23): VPC Service Controls, CMEK, Secret Manager.
- Day-one baseline (Q25): the Organization Policy constraints you would enable first.
When to use which control
Use IAM for access, Organization Policy for configuration limits you never want broken, firewall policies for traffic, VPC Service Controls for sensitive data services such as BigQuery and Cloud Storage, and CMEK when a regulation or customer requires key control. Adding controls has an operating cost, so say which risk justifies each one.
Confused with
| Pair | Difference to state |
|---|---|
| VPC peering vs Shared VPC | Peering connects two VPCs that stay separately administered; Shared VPC centralises one network that many projects use. |
| Cloud NAT vs Private Google Access | NAT gives private instances outbound access to the internet; Private Google Access reaches Google APIs without an external IP. |
| Deny policy vs Organization Policy | A deny policy blocks specific permissions for principals; a constraint limits resource configuration. |
| Secret Manager vs KMS | Secret Manager stores and versions secrets; KMS manages keys that encrypt data and does not store your secret values. |
Common misunderstandings
- "A private IP means no exposure." A VM with only a private IP can still use a service account with broad permissions.
- "Service accounts are like users." They are principals and resources at once; who may impersonate them matters as much as what they may do.
- "VPC Service Controls is a firewall." It controls API access to Google services, not packet flows.
Figure 1. The layers a request meets. Each layer has its own log entry and its own error message.
Figure 2. Shared VPC with a folder-level firewall policy. Say who owns each box when you draw it.
The animation follows a CI job that authenticates without a key and then makes API calls. It shows the token exchange, the attribute condition, the organization policy check and a perimeter violation being logged. Use it to rehearse how you explain "why did the pipeline fail?".
Interviewers often ask "how would you verify that?". These read-only commands are the ones to know. Write commands are marked and explain their cost. Check gcloud … --help for the flags in your SDK version.
gcloud projects get-iam-policy
Purpose. Lists who holds which role on a project, including inherited bindings only when you ask for them in the console; this command shows the project's own policy.
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --format="table(bindings.role,bindings.members)" --filter="bindings.role:roles/owner"
ROLE MEMBERS roles/owner group:prod-owners@example.com
Flags. --flatten gives one row per member; --filter narrows to a role. Common errors. PERMISSION_DENIED without resourcemanager.projects.getIamPolicy. Production use: alert on basic roles and on user (not group) members. Cost: free.
gcloud iam service-accounts list and keys
Purpose. Shows service accounts and whether any have user-managed keys, which is a classic audit finding.
gcloud iam service-accounts list --project=PROJECT_ID gcloud iam service-accounts keys list --iam-account=SA_EMAIL --managed-by=user
KEY_ID CREATED_AT EXPIRES_AT Listed 0 items.
Flags. --managed-by=user excludes system-managed keys. Common errors. No iam.serviceAccountKeys.list permission. Production use: the goal is zero user-managed keys, enforced by constraints/iam.disableServiceAccountKeyCreation. Cost: free.
gcloud iam workload-identity-pools providers describe
Purpose. Shows the attribute mapping and condition of a federation provider, which is the control that limits which repository may authenticate.
gcloud iam workload-identity-pools providers describe PROVIDER_ID --workload-identity-pool=POOL_ID --location=global --project=PROJECT_ID
attributeCondition: assertion.repository == 'example-org/infra' attributeMapping: attribute.repository: assertion.repository google.subject: assertion.sub name: projects/123456789012/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID state: ACTIVE
Common errors. A missing or too-broad condition means any repository from the issuer could authenticate. Production use: review conditions with each change. Cost: free.
gcloud compute networks subnets list and Shared VPC checks
Purpose. Confirms the network layout and which projects are attached to a host project.
gcloud compute networks subnets list --project=HOST_PROJECT_ID --format="table(name,region,ipCidrRange)" gcloud compute shared-vpc list-associated-resources HOST_PROJECT_ID
NAME REGION IP_CIDR_RANGE snet-prod-ew europe-west1 10.10.0.0/20
Common errors. A service project that cannot see the subnet lacks roles/compute.networkUser on it. Production use: compare with the IP plan. Cost: free.
gcloud compute firewall-policies list
Purpose. Lists hierarchical firewall policies at the organization, to prove central network control.
gcloud compute firewall-policies list --organization=ORG_ID
Common errors. Empty output means none are defined or you lack compute.firewallPolicies.list. Production use: attach the output to audit evidence. Check gcloud compute firewall-policies --help for the subcommands in your SDK version. Cost: free.
gcloud kms keys list
Purpose. Lists keys in a key ring with purpose, rotation period and state; it shows whether CMEK keys rotate.
gcloud kms keys list --location=REGION --keyring=KEYRING_NAME --format="table(name.basename(),purpose,rotationPeriod,primary.state)"
NAME PURPOSE ROTATION_PERIOD STATE key-bq-prod ENCRYPT_DECRYPT 7776000s ENABLED
Common errors. Key rings are regional; the location must match. Production use: alert when a key is disabled, because dependent services fail. Cost: free to list; key versions are billed, check pricing before creating.
gcloud secrets list
Purpose. Lists Secret Manager secrets without showing values, to confirm that application secrets live there and not in code.
gcloud secrets list --project=PROJECT_ID --format="table(name,replication.automatic,labels)"
Common errors. Secret Manager API not enabled. Production use: access to secret versions is a separate permission (roles/secretmanager.secretAccessor). Cost: free to list.
Lab: threat walk-through with read-only evidence (about 20 minutes, no cost)
Goal. Choose three attacker steps and name the layer and the command that would show or stop each one. IDs in the expected output are illustrative.
Prerequisites. A sandbox project with at least roles/viewer, Cloud Shell and the ability to list IAM and networks. No real secrets. Do not change anything.
- Scenario. Write: "An attacker obtains a service account key from a repository."
- Detect. Run
gcloud iam service-accounts keys list --iam-account=SA_EMAIL --managed-by=userfor a lab service account. Note whether any user-managed key exists. - Limit. Run
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --format="table(bindings.role,bindings.members)". Circle every basic role (roles/owner,roles/editor) and every user member. - Contain. Run
gcloud compute networks list --project=PROJECT_ID. Note whether thedefaultnetwork exists and whether the project is attached to a Shared VPC. - Explain. Answer Q14, Q18 and Q21 aloud in 90 seconds each, linking each answer to the evidence you found.
Verification. You can state for each step which layer (identity, IAM, network, perimeter, keys) would act, and the exact command that supports your claim.
Listed 0 items.
Cost. Free; read-only. Cleanup. None.
Optional: build a one-page threat table
Create three rows: leaked key, public bucket, compromised pipeline. For each, write the preventive control, the detective control and the recovery step. Bring it to the module 8 mock interview.
Real cases behind the questions
- Keys in repositories. A team stored a service account key in a build repository. A scan found it months later. The fix was Workload Identity Federation for the pipeline,
iam.disableServiceAccountKeyCreationon the production folder, and an inventory of existing keys with owners. - Flat network with shared admin. Every team created its own VPC and peered them. Overlapping ranges blocked a later on-premises connection. The platform team moved to Shared VPC with an IP plan and hierarchical firewall policies, and left peering for the few cases that needed separate administration.
- Perimeter without dry run. A VPC Service Controls perimeter around analytics projects broke a scheduled export from outside the perimeter. The next time, the team ran the perimeter in dry-run mode for two weeks, read the violation logs, and added specific ingress rules before enforcing.
Practices
- Bind roles to groups, review basic roles monthly, and use IAM Recommender output as a starting point for cuts.
- Keep firewall intent in the folder policy, and keep project rules for application-specific needs.
- Treat key disablement as an incident: alert, and document who may disable CMEK keys.
Twelve questions (Q14 to Q25) with model answers, then a quick index and a triage order for when you are asked "what went wrong?".
Model answers Q14 to Q25
Q14 Why should you avoid service account keys, and what do you use instead?
Short answer. Keys are long-lived credentials that leak; use attached service accounts, impersonation or federation.
Reasoning. A key file works from anywhere until it is deleted, and it is hard to know who holds a copy. Short-lived tokens expire and can be tied to the caller's identity.
Example. Workloads on Compute Engine use an attached service account; humans and CI use --impersonate-service-account; the constraint iam.disableServiceAccountKeyCreation blocks new keys.
Pitfall. Granting roles/iam.serviceAccountTokenCreator broadly. It lets the holder act as the account.
Q15 How does Workload Identity Federation work?
Short answer. An external identity provider's token is exchanged for a short-lived Google credential.
Reasoning. A workload identity pool trusts a provider such as GitHub OIDC. Attribute mapping and a condition decide which external identities are accepted, and a binding lets the mapped principal impersonate a service account.
Example. A pool provider with condition assertion.repository == 'example-org/infra' and roles/iam.workloadIdentityUser on the deployer account.
Pitfall. A missing condition lets any repository on that issuer authenticate.
Q16 How do you apply least privilege at scale?
Short answer. Group-based bindings, predefined roles at the lowest sensible scope, and continuous reduction.
Reasoning. Individual grants are impossible to review. Groups tie access to joiner, mover and leaver processes. Basic roles are too broad for production.
Example. group:prod-sre@example.com bound to a predefined role on the production folder; IAM Recommender reviews unused permissions.
Pitfall. Granting at the organization "for convenience". Inheritance spreads the mistake to every project.
Q17 What are IAM Conditions and deny policies for, and how do they differ from Organization Policy?
Short answer. Conditions narrow a grant; deny policies override grants; Organization Policy limits configuration.
Reasoning. A condition makes a role apply only for a time, resource name or tag. A deny policy blocks named permissions for principals even if a role allows them. A constraint does not mention principals at all.
Example. A temporary on-call grant with an expiry condition; a deny policy on iam.googleapis.com/serviceAccountKeys.create except for a break-glass group.
Pitfall. Expired conditional bindings that silently remove access during an incident.
Q18 Shared VPC or VPC peering?
Short answer. Shared VPC for central control inside one organization; peering when networks must stay separately administered.
Reasoning. Shared VPC gives one IP plan, one firewall model and delegated subnet access. Peering is non-transitive and needs non-overlapping ranges, so many peerings become hard to manage.
Example. A host project with regional subnets and service projects granted roles/compute.networkUser per subnet.
Pitfall. Making teams network admins in the host project. They then change shared routes and firewalls.
Q19 What are hierarchical firewall policies and when do you use them?
Short answer. Rules attached to the organization or a folder that are evaluated before VPC rules.
Reasoning. They enforce baselines, for example denying inbound administration ports from the internet, and can delegate with goto_next so projects can add their own rules below.
Example. A folder policy that denies ingress on port 22 from 0.0.0.0/0 and allows load balancer health check ranges.
Pitfall. Priority mistakes. A broad deny with a lower number can block traffic that a project rule was meant to allow.
Q20 How do private workloads reach the internet and Google APIs?
Short answer. Cloud NAT for outbound internet, Private Google Access for Google APIs, Private Service Connect for private endpoints.
Reasoning. Instances without external IPs reduce exposure. NAT gives controlled outbound access and stable addresses; Private Google Access lets them reach Google APIs on internal paths.
Example. A Cloud Router and Cloud NAT per region, plus constraints/compute.vmExternalIpAccess denied by policy.
Pitfall. Forgetting NAT logging and port limits; under heavy use connections can fail from port exhaustion.
Q21 What is VPC Service Controls and when is it needed?
Short answer. A perimeter that restricts API access to protected Google services to reduce data exfiltration.
Reasoning. IAM cannot stop a legitimate user copying data to a project outside the company. A perimeter blocks calls that cross the boundary unless an ingress or egress rule allows them.
Example. A perimeter around BigQuery and Cloud Storage projects, with an access level for the corporate network and a dry run first.
Pitfall. Enforcing without dry run. Pipelines such as Cloud Build and exports then fail unexpectedly.
Q22 When would you use CMEK?
Short answer. When a requirement demands customer control of encryption keys or revocation.
Reasoning. All data is encrypted at rest by default. CMEK adds control over rotation and access to the key, and an audit trail, in exchange for operations: a disabled key makes data unavailable.
Example. A Cloud KMS key with a rotation period, used by a BigQuery dataset, with the service agent granted roles/cloudkms.cryptoKeyEncrypterDecrypter.
Pitfall. Placing keys in the same project as the data, so one administrator controls both.
Q23 How do you manage secrets?
Short answer. In Secret Manager, accessed by identity, never in code or images.
Reasoning. Secrets need versioning, rotation, access control and audit. Granting secretAccessor to the workload identity removes the need to distribute a credential.
Example. gcloud secrets create with automatic replication, and a service account granted access to one secret only.
Pitfall. Granting access at the project level, which exposes every secret in it.
Q24 HA VPN or Cloud Interconnect?
Short answer. HA VPN for quick, encrypted, moderate-bandwidth links; Interconnect for high, predictable throughput.
Reasoning. Both use Cloud Router and BGP. HA VPN needs two tunnels for its availability commitment. Interconnect needs lead time and redundant attachments for its commitment.
Example. HA VPN as the first connection and as backup, Partner Interconnect added when volume justifies it.
Pitfall. One tunnel or one attachment labelled "highly available".
Q25 Which Organization Policy constraints would you enable on day one?
Short answer. The ones that remove the most common avoidable risks.
Reasoning. Block keys, public exposure and wrong locations early, because retrofitting after resources exist means exceptions and clean-up work.
Example. iam.disableServiceAccountKeyCreation, iam.allowedPolicyMemberDomains, gcp.resourceLocations, compute.vmExternalIpAccess, compute.requireOsLogin, compute.skipDefaultNetworkCreation, storage.uniformBucketLevelAccess.
Pitfall. Enforcing everything at the root. Start on a test folder and use dry-run or a staged rollout.
Question index
| No. | Topic | One-line answer key |
|---|---|---|
| Q14 | Service account keys | Avoid keys; impersonation or attached identities |
| Q15 | Workload Identity Federation | Token exchange plus attribute condition |
| Q16 | Least privilege | Groups, predefined roles, lowest scope |
| Q17 | Conditions and deny | Narrow, override, versus configuration limits |
| Q18 | Shared VPC vs peering | Central control versus separate administration |
| Q19 | Firewall policies | Hierarchical, evaluated first, goto_next |
| Q20 | Private egress | Cloud NAT, Private Google Access, PSC |
| Q21 | VPC Service Controls | Perimeter against exfiltration, dry run first |
| Q22 | CMEK | Key control with operational duty |
| Q23 | Secrets | Secret Manager by identity |
| Q24 | Hybrid links | HA VPN fast; Interconnect for throughput |
| Q25 | Day-one constraints | Keys, domains, locations, external IPs, OS Login |
Triage order when asked "what went wrong?"
- Name the layer: identity, IAM, constraint, firewall, perimeter or key.
- Name the log that would show it: audit log, policy denied entry, VPC Service Controls violation, firewall log.
- State the first read-only command.
- Only then propose the fix, and say how you would prevent a repeat.
Common faults
| Symptom in your answer | Likely cause | First fix |
|---|---|---|
| You say "IAM" for every problem | No layer model | Use the five-layer table before answering |
| You recommend a key file | Habit from older tutorials | Rehearse the federation answer |
| No mention of dry run | Rollout risk ignored | Add "dry run, then enforce" for perimeters and policies |
| Confusing VPC SC with firewall | Both say "perimeter" | Remember: API calls versus packets |
| Cannot name a constraint | Catalogue not memorised | Learn the seven in Q25 |
Video links are search pages, not pinned videos. Check the date against the documentation you use.
- YouTube search: Workload Identity Federation with GitHub Actions
- YouTube search: Shared VPC explained
- YouTube search: VPC Service Controls and dry run
- YouTube search: Cloud KMS, CMEK and Secret Manager
Official reading: Workload Identity Federation · Shared VPC · VPC Service Controls · CMEK.
Module 7 · Interview questions on operations, logging, cost and infrastructure as code
- Explain audit log types, centralised log routing, alerting and asset inventory as one operational evidence chain.
- Answer cost-governance questions, including why budgets alert but do not cap spending, with a Google Cloud example.
- Describe Terraform state, a project factory, keyless CI/CD, drift detection and provider pinning with their pitfalls.
The short answer
Operations questions test whether you can prove what happened, be told early, control cost and change things safely. The same chain appears everywhere: an action is recorded in an audit log, routed by a sink to a central bucket, turned into a metric or alert, and reviewed. Cost has a parallel chain: labels, budgets, billing export and reports. Infrastructure as code (IaC) is how the landing zone changes safely: a pull request, a plan, an approval, an apply by a pipeline identity.
What: the operational evidence chain
| Step | Question it answers | Google Cloud building block |
|---|---|---|
| Record | What happened? | Cloud Audit Logs: Admin Activity, Data Access, System Event, Policy Denied |
| Route | Where does the evidence go? | Log Router, sinks, log buckets, retention |
| Detect | Do we get told? | Log-based metrics, Cloud Monitoring alerting policies, notification channels |
| Inventory | What exists, and what changed? | Cloud Asset Inventory, asset feeds, exports |
| Cost | Who spends what? | Budgets, labels, billing export to BigQuery |
| Change | How is it modified safely? | Terraform, remote state, CI/CD with Workload Identity Federation |
Why this matters
After an incident, the first questions are "who changed it, when, and from where?". Without a central, protected log you answer with guesses. After a surprise bill, the question is "which project and which label?". After a bad change, the question is "what did the plan say and who approved it?". Each of these is a design decision made in advance.
How the questions are grouped
- Logging and monitoring (Q26 to Q29): audit log types, centralised logging, sink permissions, alerting.
- Cost (Q30, Q31): budgets and cost control, billing export and labels.
- Infrastructure as code (Q32 to Q36): state, project factory, keyless CI/CD, drift, version pinning.
- Inventory (Q37): Cloud Asset Inventory.
When to choose which option
Use log buckets with Log Analytics for interactive investigation, BigQuery sinks for long-term analysis and joins, and Cloud Storage for cheap archival and legal retention. Use budgets for alerts, billing export for analysis, and quotas or policy for hard limits. Use a monolithic Terraform root only for tiny labs; use stages and modules for a landing zone.
Confused with
| Pair | Difference to state |
|---|---|
| Audit log vs application log | Audit logs record API calls on Google Cloud resources; application logs are what your code writes. |
| Budget vs quota | A budget alerts on cost; a quota limits the amount of a resource that can be used. |
| Cloud Monitoring vs Cloud Logging | Logging stores and searches entries; Monitoring evaluates metrics and alerts. Log-based metrics connect them. |
| State vs reality | State is Terraform's record; reality is what exists. Drift is the gap between code, state and reality. |
Common misunderstandings
- "Data Access logs are on, so we are covered." They are mostly off by default and cost money. Enable them for sensitive services deliberately.
- "A budget protects us." It informs you. A forgotten large resource still costs money until someone acts.
- "The state bucket is just a file." It can contain secrets and controls what is destroyed; treat it as a protected asset.
Figure 1. Organization sink with children included. Look at the writer identity and the three destinations with different purposes.
Figure 2. Change flow for infrastructure as code. Say who approves, which identity applies, and where state lives.
The animation follows an IAM policy change from the audit entry to an alert. It shows recording, routing by the sink, a log-based metric and a notification. Practise narrating it as the answer to "how would you detect a risky change within minutes?".
Know these read-only commands and explain the output. Write commands say whether they cost money. Check gcloud … --help for the flags in your SDK version.
gcloud logging read
Purpose. Reads audit entries, for example every IAM policy change in a project in the last day.
gcloud logging read 'protoPayload.methodName="SetIamPolicy"' --project=PROJECT_ID --freshness=1d --limit=5 --format="table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.resourceName)"
TIMESTAMP PRINCIPAL_EMAIL RESOURCE_NAME 2026-11-24T09:12:44.123456Z ci-deployer@PROJECT_ID.iam.gserviceaccount.com projects/PROJECT_ID
Flags. --freshness limits the age, --limit the count, --format the columns. Output is illustrative. Common errors. No entries because Data Access logs are off, or the filter field is misspelled. Production use: a runbook for incident evidence. Cost: reading is free within the free allotment of log reads; check pricing.
gcloud logging sinks list and describe
Purpose. Shows the routing, filter and writer identity of sinks at the organization.
gcloud logging sinks list --organization=ORG_ID gcloud logging sinks describe SINK_NAME --organization=ORG_ID
destination: logging.googleapis.com/projects/LOGGING_PROJECT_ID/locations/global/buckets/central-audit filter: logName:"cloudaudit.googleapis.com" includeChildren: true name: org-audit writerIdentity: serviceAccount:o123456789012-111111@gcp-sa-logging.iam.gserviceaccount.com
Common errors. writerIdentity lacks a role on the destination. Production use: grant the writer identity only the role needed. Cost: free to list.
gcloud logging buckets list
Purpose. Lists log buckets with retention, to prove that the central bucket keeps data as long as policy says.
gcloud logging buckets list --project=LOGGING_PROJECT_ID --location=global --format="table(name,retentionDays,locked)"
NAME RETENTION_DAYS LOCKED _Default 30 False _Required 400 True central-audit 365 False
Common errors. Wrong location. Production use: a locked bucket cannot shorten its retention, so decide carefully. Cost: free to list; stored data is billed.
gcloud billing budgets list
Purpose. Lists budgets on a billing account with their thresholds, so you can show how overspend is signalled.
gcloud billing budgets list --billing-account=BILLING_ACCOUNT_ID
Common errors. The Billing Budget API must be enabled and you need billing permissions. Production use: budgets per folder or project with alert thresholds. Budgets send alerts and do not cap spend. Cost: free.
terraform plan -detailed-exit-code
Purpose. Detects drift in a pipeline. Exit code 0 means no changes, 1 means error, 2 means changes are present.
terraform init terraform plan -detailed-exitcode -out=tfplan; echo "exit=$?"
No changes. Your infrastructure matches the configuration. exit=0
Flags. -detailed-exitcode sets the codes above; -out saves the plan so apply uses exactly what was reviewed. Common errors. Backend authentication failures and state lock. Production use: schedule it per stage and alert on exit 2. Cost: free to run, other than the API calls.
gcloud asset search-all-resources
Purpose. Searches inventory across the organization, for example for resources with a missing label.
gcloud asset search-all-resources --scope=organizations/ORG_ID --query="NOT labels:cost-center" --asset-types=compute.googleapis.com/Disk --format="table(name,location)"
Common errors. The Cloud Asset API is not enabled; the query syntax differs from log filters. Production use: weekly report of unlabeled resources. Cost: free for search.
Lab: evidence chain rehearsal (about 25 minutes, free to low cost)
Goal. Generate an audit event, find it, and describe the routing and alerting you would add. IDs in the expected output are illustrative.
Prerequisites. A sandbox project where you can create a label, roles/logging.viewer and Cloud Shell. Do not create sinks or budgets in a shared project. No secrets are needed.
- Create an event. Add a label to the sandbox project:
gcloud projects update PROJECT_ID --update-labels=interview=lab. This is a metadata change and is free. - Find the event. Run
gcloud logging read 'protoPayload.methodName="UpdateProject" OR protoPayload.methodName:"SetIamPolicy"' --project=PROJECT_ID --freshness=1h --limit=3. Entries can take a minute to appear. - Check routing. Run
gcloud logging sinks list --project=PROJECT_IDandgcloud logging buckets list --project=PROJECT_ID --location=global. Note the retention of_Defaultand_Required. - Explain. Answer Q26, Q27 and Q30 aloud, using the entry you found as the example.
- Design. On paper write the alert you would add: log-based metric on SetIamPolicy by a non-pipeline principal, an alerting policy and a notification channel.
Verification. You can show an audit entry with principal, method and resource, and explain where it would be kept.
insertId: abc123
protoPayload:
methodName: UpdateProject
authenticationInfo:
principalEmail: you@example.com
Cost. Free; the label change and reading logs are within free usage. Cleanup. gcloud projects update PROJECT_ID --remove-labels=interview.
Optional: cost question rehearsal
List three cost surprises you have seen or read about (an idle disk, log ingestion growth, cross-region egress). For each write the label, budget or report that would have shown it earlier.
Real cases behind the questions
- Logs that were not there. After an incident a team found that an exclusion filter, created to save cost, dropped the entries they needed. The platform team moved audit logs to an organization sink with no exclusions, kept costly application logs on separate filters, and documented who may change filters.
- Ingestion cost spike. A debug flag raised application log volume tenfold. Alerts on a budget fired late. The team added a log-based alert on ingestion volume, set per-project exclusions for debug levels, and lowered retention in non-production.
- State corruption by parallel applies. Two engineers applied from laptops with a local backend copy. After moving to a Cloud Storage backend with versioning and locks, and to applies only from the pipeline, the problem stopped and recovery from a prior state version became possible.
Practices
- Send audit logs to a central logging project with restricted access, and protect the sink and bucket from deletion.
- Pin Terraform and provider versions, use a lock file, and upgrade in a non-production stage first.
- Review budgets, labels and unlabeled resources monthly with finance.
Twelve questions (Q26 to Q37) with model answers, then a quick index and a triage order for operational failure stories.
Model answers Q26 to Q37
Q26 What are the Cloud Audit Logs types, and which would you enable?
Short answer. Admin Activity, Data Access, System Event and Policy Denied.
Reasoning. Admin Activity is always on and records configuration changes. Data Access records reads and writes of data and is mostly off because of volume. System Event covers Google actions. Policy Denied shows requests blocked by security policy.
Example. Enable Data Access for BigQuery and Cloud Storage in sensitive projects only.
Pitfall. Turning Data Access on everywhere without estimating ingestion cost.
Q27 How do you design centralised logging?
Short answer. An organization sink with children included, into a protected logging project.
Reasoning. A central, access-controlled destination survives deletion of a workload project, and one place makes investigation and retention simple.
Example. Sink with filter logName:"cloudaudit.googleapis.com" to a log bucket with long retention, and a BigQuery copy for analysis.
Pitfall. Letting workload teams hold admin rights on the logging project.
Q28 A sink is configured but no logs arrive. What do you check?
Short answer. Writer identity permission, filter, exclusions, then destination.
Reasoning. The sink writes as its writer identity, which needs a role on the destination. Filters and exclusions may drop entries. Destination limits or a wrong location are the next causes.
Example. gcloud logging sinks describe to read the writer identity, then grant roles/logging.bucketWriter on the bucket.
Pitfall. Using the unique writer identity option incorrectly, then granting access to the wrong principal.
Q29 How do you design alerting that people trust?
Short answer. Alert on symptoms and a few high-value audit events, with an owner and a runbook.
Reasoning. Too many alerts cause fatigue. Every alert should map to an action and to someone responsible.
Example. A log-based metric on SetIamPolicy at the organization, an alerting policy and a notification channel to the security on-call.
Pitfall. Alerts to an email list nobody reads.
Q30 Does a budget stop spending? How do you control cost?
Short answer. No, budgets alert; control comes from policy, quota, automation and ownership.
Reasoning. Alerts at several thresholds tell owners early. Hard stops need a designed response, because disabling billing can take down production.
Example. Budgets per folder with notifications to a Pub/Sub topic, plus quota limits and a sandbox folder with an automatic clean-up of old projects.
Pitfall. An automatic shutdown on production budgets without a safe list.
Q31 How do billing export and labels support allocation?
Short answer. Export gives line-item data in BigQuery; labels attach owners.
Reasoning. Console reports are summaries. A BigQuery export can be joined with a cost-center table and charged back by team.
Example. Labels cost-center, env and owner set by the project factory, and a dashboard by label.
Pitfall. Labels are applied after the fact; costs before that cannot be reallocated by label.
Q32 How do you manage Terraform state?
Short answer. Remote in a Cloud Storage bucket with versioning, locking and tight access, split per stage.
Reasoning. A shared backend prevents concurrent edits and allows recovery. State may include sensitive values, so access is limited.
Example. A bucket with uniform bucket-level access and versioning, created at bootstrap, referenced by a backend "gcs" block.
Pitfall. One state for everything, or a state bucket that every developer can read.
Q33 What is a project factory and why use one?
Short answer. A module that creates projects with standard settings.
Reasoning. It guarantees labels, billing link, enabled APIs, budgets, Shared VPC attachment and deletion protection, so teams get compliant projects without tickets.
Example. A pull request that adds one entry to a list of projects triggers a plan and, after approval, creates the project.
Pitfall. No deletion protection: removing an entry from the list can delete a project.
Q34 How do you run Terraform in CI/CD safely?
Short answer. Plan on pull request, apply after approval, with keyless identity per layer.
Reasoning. Reviewed plans are the change record. Federation removes keys. One account per stage limits blast radius.
Example. GitHub Actions with google-github-actions/auth and Workload Identity Federation, a read-only plan identity and an apply identity per stage.
Pitfall. Applying a fresh plan after approval; always apply the saved plan that was reviewed.
Q35 How do you detect and handle drift?
Short answer. Scheduled plans with detailed exit code, then fix code or revert reality.
Reasoning. Console edits during incidents are normal; the goal is to find them and decide. Restrict console write access in production to reduce them.
Example. A nightly job runs terraform plan -detailed-exitcode and posts exit code 2 to a channel; Cloud Asset feeds give near-real-time hints.
Pitfall. Auto-applying to remove drift without review; it may undo an emergency fix.
Q36 How do you manage provider and module versions?
Short answer. Pin the major version, commit the lock file, upgrade on purpose.
Reasoning. An unpinned provider can change behaviour between runs and break a plan.
Example. required_providers with a version constraint, .terraform.lock.hcl in the repository, upgrades tested in non-production.
Pitfall. Running init -upgrade in a production pipeline.
Q37 How do you use Cloud Asset Inventory?
Short answer. As the searchable record of what exists and how it changed.
Reasoning. It answers inventory and compliance questions without scripting each API, supports exports and change feeds, and feeds drift and audit reports.
Example. gcloud asset search-all-resources to list unlabeled disks; an export to BigQuery for reporting.
Pitfall. Assuming it is real time. Feeds help, but search results can lag.
Question index
| No. | Topic | One-line answer key |
|---|---|---|
| Q26 | Audit log types | Admin always on; Data Access deliberately |
| Q27 | Central logging | Org sink, children included, protected project |
| Q28 | No logs in sink | Writer identity, filter, exclusion, destination |
| Q29 | Alerting | Few symptoms, owner, runbook |
| Q30 | Budgets | Alert, not cap; policy and automation |
| Q31 | Billing export | BigQuery plus labels for allocation |
| Q32 | Terraform state | Remote, versioned, locked, per stage |
| Q33 | Project factory | Standard compliant projects by pull request |
| Q34 | CI/CD | Plan on PR, apply approved plan, WIF |
| Q35 | Drift | Scheduled plan with exit code 2 |
| Q36 | Version pinning | Pin major, lock file, upgrade deliberately |
| Q37 | Asset Inventory | Search, export, feeds |
Triage order for operational stories
- State the symptom and the time window.
- Check the audit log for the change that matches the window.
- Check what the plan or pipeline did at that time.
- Check cost and quota if the symptom is resource limits or a bill.
- Fix, then add the preventive control and the alert that would have caught it.
Common faults
| Symptom in your answer | Likely cause | First fix |
|---|---|---|
| You claim budgets cap spend | Confusing alert and enforcement | Say "alert, plus automation you build" |
| No mention of who approves | CI/CD seen as a tool only | Add the approval and the identity |
| Local state suggested | Tutorial habit | State remote backend, versioning, lock |
| Cannot explain sink permission | Missing writer identity concept | Rehearse Q28 |
| Everything auto-applied | No change control | Name the approval step and drift review |
Video links are search pages, not pinned videos. Check the date against the documentation you use.
- YouTube search: audit logs and Log Router sinks
- YouTube search: billing export and budgets
- YouTube search: Terraform remote state on Google Cloud
- YouTube search: Terraform pipelines with Workload Identity Federation
Official reading: Cloud Audit Logs · Configure and manage sinks · Budgets and alerts · Store Terraform state in Cloud Storage.
Module 8 · Scenario and behavioural interview questions and a mock-interview routine
- Answer scenario questions by stating the first safe action, the diagnosis path, the fix and the prevention, in that order.
- Tell behavioural stories in a clear structure (situation, action, result, lesson) using landing-zone examples without naming a real employer.
- Run a timed mock interview and score it with a rubric, so you know which skill to practise next.
The short answer
Scenario and behavioural questions test judgement under pressure and how you work with people. Technical knowledge is assumed; what the interviewer wants to see is order of actions, use of evidence, respect for risk, and honest communication. For a scenario, follow the same five steps every time: contain, diagnose, fix, prevent, communicate. For a behavioural question, use situation, action, result, lesson.
What: two frameworks
| Question type | Framework | Landing-zone example |
|---|---|---|
| Scenario | Contain, diagnose, fix, prevent, communicate | Leaked key: disable it, read audit logs, remove the cause, block keys by policy, report to the owner. |
| Behavioural | Situation, action, result, lesson | Disagreement with security about a perimeter: the dry-run data, the compromise, the outcome, the lesson. |
Why this matters
Platform work is a service to other engineers. A technically perfect design that nobody uses or that creates conflict fails. Interviewers for landing-zone roles often ask about saying no, about incidents and about working with security and finance, because those situations decide success more than product knowledge does.
How the thirteen questions are grouped
- Operational scenarios (Q38 to Q43): urgent project request, a blocking policy, a leaked key, a cost spike, Terraform trouble, a perimeter that breaks a pipeline.
- Design scenarios (Q44, Q45): regulated workload, migrating unmanaged projects.
- Behavioural (Q46 to Q50): disagreement, an incident you caused, saying no, explaining to executives, measuring a platform team.
When you are stuck in a scenario
Say it aloud: "Before I change anything, I want to know three things: what changed, who is affected, and whether this is still happening." That sentence shows structure and gives you time. Then pick the first read-only command that answers one of the three.
Confused with
| Pair | Difference to state |
|---|---|
| Containment vs fix | Containment stops the damage now and may be temporary; a fix removes the cause. |
| Root cause vs trigger | The trigger is what happened last; the root cause is why the system allowed it. |
| Blame vs accountability | Blameless reviews still assign actions to owners; they do not assign guilt. |
| Saying no vs offering an alternative | A strong platform engineer declines the request but meets the need another way. |
Common misunderstandings
- "Behavioural questions are soft, so I will improvise." The best stories are prepared, specific and short, with numbers where you honestly have them.
- "The fix is the answer." In an incident answer, prevention and detection carry equal weight.
- "I must have a perfect story." A mistake with a clear lesson is stronger than a flawless story that sounds invented.
Story bank to prepare
Prepare five short stories, each 90 seconds: an incident you handled, a time you disagreed and resolved it, a time you said no, a time you simplified something, and a time you learned a new service quickly. Use a fictional or generic framing if you cannot share details, and never name your employer's real project IDs.
Figure 1. The five-step scenario answer. The same flow works for keys, costs, denied deployments and broken pipelines.
Figure 2. The 45-minute mock interview used in the Lab tab.
The animation follows the leaked-key scenario from alert to prevention: the alert reaches the on-call engineer, the evidence is read from the audit log, the key is contained, and a policy is applied through the pipeline. Use it as the model for your own scenario answers.
In scenario questions you are expected to name the first command you would run. These are the ones to know. Write commands say whether they cost money. Check gcloud … --help for the flags in your SDK version.
gcloud logging read for who created a key
Purpose. Finds who created a service account key and when.
gcloud logging read 'protoPayload.methodName="google.iam.admin.v1.CreateServiceAccountKey"' --project=PROJECT_ID --freshness=7d --format="table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.resourceName)"
TIMESTAMP PRINCIPAL_EMAIL RESOURCE_NAME 2026-11-24T02:14:09.100Z unknown@example.com projects/-/serviceAccounts/1234567890
Common errors. Empty result when the filter is wrong or the window is too short. Output is illustrative. Production use: the first evidence command for a key incident. Cost: free within log read allowances.
gcloud iam service-accounts keys delete (write)
Purpose. Contains a leaked key by deleting it. Disable is a safer first step when you are unsure whether production depends on it.
gcloud iam service-accounts keys disable KEY_ID --iam-account=SA_EMAIL gcloud iam service-accounts keys delete KEY_ID --iam-account=SA_EMAIL
Deleted key [KEY_ID] for service account [SA_EMAIL]
Flags. --iam-account names the service account. Common errors. PERMISSION_DENIED without roles/iam.serviceAccountKeyAdmin. Production use: disable first, observe, then delete. Cost: free.
gcloud org-policies describe --effective
Purpose. Shows why a deployment is blocked by displaying the effective constraint at a project.
gcloud org-policies describe gcp.resourceLocations --project=PROJECT_ID --effective
Common errors. The constraint name is written without the constraints/ prefix in this form; if the command says it is not found, check gcloud org-policies describe --help for the form in your SDK version. Production use: attach the output to the exception request. Cost: free.
gcloud billing projects describe and the cost check
Purpose. First confirms which billing account a surprising project uses; cost detail then comes from the BigQuery export.
gcloud billing projects describe PROJECT_ID
Common errors. No billing permission on the project. Production use: pair with a saved BigQuery query that groups cost by project, service and label for the last seven days. Cost: free to run; BigQuery queries are billed by data scanned, so filter by date.
gcloud projects get-iam-policy for an access request
Purpose. Shows existing bindings before you grant or refuse an access request.
gcloud projects get-iam-policy PROJECT_ID --flatten="bindings[].members" --filter="bindings.members:user:" --format="table(bindings.role,bindings.members)"
Common errors. Missing resourcemanager.projects.getIamPolicy. Production use: find direct user bindings and replace them with groups. Cost: free.
terraform force-unlock (write, use with care)
Purpose. Releases a stale state lock after a pipeline was killed. It does not change infrastructure, but unlocking while another apply runs can corrupt state.
terraform force-unlock LOCK_ID
Terraform state has been successfully unlocked!
Common errors. Wrong lock ID. Production use: confirm that no apply is running, and record who unlocked and why. Cost: free.
Lab: the 45-minute mock interview with a scoring rubric (no cost)
Goal. Run one timed mock interview with a partner, score it, and choose one skill to improve. IDs in any example output are illustrative.
Prerequisites. A partner (a colleague or a friend who can read this module), a timer, a recorder on a phone, and the list Q1 to Q50 from modules 5 to 8. No cloud resources are needed, and no real secrets or employer details should be used.
Timed drill
- Prepare (5 minutes). The partner picks 8 questions from Q1 to Q50: four from modules 5 to 7, two scenarios from Q38 to Q45, two behavioural from Q46 to Q50. Choose them at random so you cannot pre-select.
- Warm-up (0 to 5 minutes). You introduce yourself in 60 seconds and describe a landing-zone decision you made or studied.
- Design and technical (5 to 25 minutes). Four questions, 90 seconds each, then one follow-up each. Use the four moves: short answer, reasoning, example, pitfall.
- Scenarios (25 to 35 minutes). Two scenarios, 4 minutes each. Use contain, diagnose, fix, prevent, communicate. Name the first command.
- Behavioural (35 to 40 minutes). Two stories, 2 minutes each, situation, action, result, lesson.
- Score (40 to 45 minutes). The partner scores each answer with the rubric below. Then play 60 seconds of the recording to hear your pace.
Scoring rubric (0 to 3 per criterion)
| Criterion | 0 = missing | 1 = weak | 2 = good | 3 = strong |
|---|---|---|---|---|
| Structure | No order | Rambling | Mostly ordered | Clear short answer first, all moves present |
| Technical accuracy | Wrong | Mixed | Correct | Correct with right service, constraint or command |
| Trade-offs | None | Mentioned | One explained | Alternatives and costs compared |
| Risk and safety | Ignores risk | Mentions | Contains first | Contain, evidence, prevention, communication |
| Communication | Unclear | Jargon heavy | Clear | Clear, concise, checks understanding |
| Time control | Far over | Over by half | Near the limit | Within the limit, offers to go deeper |
Result bands. 0 to 18 points per question, averaged over the answers. Below 8: rebuild the base using the Concepts tabs. 8 to 12: practise pitfalls and examples. 13 to 15: polish pace and trade-offs. 16 to 18: ready; repeat monthly.
Verification. Each answer has a score on all six criteria, and you wrote one improvement sentence per low score. Example improvement: "Add the writer-identity check to every sink answer."
Q27 central logging: structure 3, accuracy 2, trade-offs 1, risk 2, communication 3, time 2 = 13 Improve: compare log bucket, BigQuery and Cloud Storage destinations in one sentence.
Cost. Free. Cleanup. Delete the recording if it contains anything private, and keep the score sheet for your next session.
Optional: a shorter 15-minute drill
Pick three questions, answer each in 90 seconds, and self-score with the rubric. Do this three times a week in the week before an interview.
Real cases behind the questions
- A friction-heavy approval process. A platform team required a ticket and two approvals for every project. Teams created projects in personal accounts to avoid the delay. The team replaced the ticket with a pull request to the project factory, with automated policy checks, and moved review to exceptions. Requests fell from days to minutes, and shadow projects were brought into the organization.
- Incident handled in the wrong order. After a leaked key, engineers first rewrote the repository history, and left the key active for a day. A later review made containment the first runbook step and added a detective alert on key creation and a preventive constraint.
- Security and delivery in conflict. A perimeter rollout blocked an export job. The two teams argued for a week. Running the perimeter in dry-run mode produced the violation log, which turned a debate into a list of three specific ingress rules and a date to enforce.
Practices
- Keep short runbooks for the common events: leaked key, denied deployment, cost spike, tunnel down, state lock.
- Run blameless reviews with owners and dates for each action, and track them to done.
- Measure the platform: lead time for a new project, policy denials, drift count, time to detect.
Thirteen scenario and behavioural questions (Q38 to Q50) with model answers, then a quick index and a list of common faults in the answers. For behavioural questions, the "Google Cloud example" is a short, generic landing-zone story.
Model answers Q38 to Q50
Q38 A team needs a project today, and there is no process. What do you do?
Short answer. Create it through the project factory, and if there is none, create the first version by hand under the right folder with the standard settings.
Reasoning. Delay drives teams to create shadow projects. Creating the project in the right folder gives inherited policy and billing immediately; then code the process.
Example. Create under the non-production folder, link billing, set labels, attach to Shared VPC, then add the entry to Terraform.
Pitfall. A hand-made project that never gets imported into code.
Q39 An organization policy blocks a production deployment at 5 pm. What do you do?
Short answer. Read the denial, check the effective policy, decide on a scoped exception, and record it.
Reasoning. A denial is the control working. Most causes are a wrong region or an external IP in a template; fixing the template is better than weakening the rule.
Example. gcloud org-policies describe --effective shows allowed locations; the team redeploys in an allowed region.
Pitfall. Removing the constraint at the organization to fix one deployment.
Q40 A service account key leaked to a public repository. What do you do?
Short answer. Contain, investigate, remove the cause.
Reasoning. Disable the key first, then read the audit log for use of the key, check what the account can access, and rotate or remove dependants.
Example. Use gcloud logging read for the account, then move the workload to an attached identity or federation, and enforce the key-creation constraint.
Pitfall. Deleting history in the repository but leaving the key active.
Q41 The monthly bill doubled overnight. What do you do?
Short answer. Find what changed by project, service and label, then who changed it.
Reasoning. A BigQuery export gives the breakdown within minutes. Audit logs show who created the resource. Then decide on stop, resize or accept.
Example. A query grouped by service shows network egress rising in one project; the audit log shows a new replication job.
Pitfall. Deleting resources before confirming that they are not production.
Q42 A Terraform apply failed halfway. What do you do?
Short answer. Do not rerun blindly; read the error, check state and the lock, then plan again.
Reasoning. Partial applies leave real resources with state that may or may not include them. A fresh plan shows the difference.
Example. Error shows a missing API; enable the service, run terraform plan, then apply. A stale lock needs checking before force-unlock.
Pitfall. Editing state by hand without a backup.
Q43 VPC Service Controls blocks a deployment pipeline. What do you do?
Short answer. Read the violation log, identify the source and service, and add a narrow rule.
Reasoning. A violation entry names the caller, the service and the perimeter. The fix is an ingress rule or access level for that identity, not a wider perimeter.
Example. Allow only the CI service account to call the specific API from the pipeline network, tested in dry run.
Pitfall. Disabling the perimeter "temporarily" and forgetting it.
Q44 Design a landing zone for a regulated workload.
Short answer. A separate folder with stricter policy, regional restrictions and logging.
Reasoning. Clarify the regime and data location first. Then limit locations, restrict identities and services, protect data with a perimeter and keys, and keep evidence.
Example. A regulated folder with resource location constraints, CMEK, VPC Service Controls and long-retention audit logs; consider Assured Workloads where the regime fits.
Pitfall. Assuming a product alone makes the workload compliant. Process and evidence are part of it.
Q45 You must bring 200 unmanaged projects into the organization. How?
Short answer. Inventory, classify, move in waves, and fix policy gaps after.
Reasoning. Moving changes inherited policy and IAM, which can break workloads. Start with an inventory of owners, billing and dependencies, then move low-risk projects first.
Example. Place projects first in a staging folder with audit-only controls, then promote them into environment folders as owners confirm.
Pitfall. Moving everything at once into a folder with enforced constraints.
Q46 Tell me about a disagreement with a security or finance team.
Short answer. Use data and a trial to turn the argument into a decision.
Reasoning. Both sides want the company safe or solvent. Shared evidence reduces opinion.
Example. A perimeter was proposed by security and feared by delivery; the dry-run log showed three real violations, and we agreed rules and a date.
Pitfall. Telling a story where you were simply right. Show what you learned.
Q47 Tell me about an incident you caused or handled.
Short answer. Own it, describe the order of actions, and the lasting change.
Reasoning. Interviewers look for honesty, containment, communication and learning.
Example. A wrong firewall priority blocked health checks; we reverted from code, wrote a test for priorities, and added an alert.
Pitfall. Blaming a colleague or the tool.
Q48 A team demands the Owner role. How do you respond?
Short answer. Ask for the need, and offer a narrower path.
Reasoning. The request hides a task. A predefined role, a custom role or a time-limited conditional grant usually covers it and keeps an audit trail.
Example. Grant a deployment role on one project for the length of a release, via a group.
Pitfall. A flat refusal that pushes teams to workarounds.
Q49 How do you explain a landing zone to a non-technical executive?
Short answer. As the foundation and safety rails that let teams move fast without risking the company.
Reasoning. Use outcomes: faster delivery, lower risk, clear cost. Avoid service names.
Example. "New projects start safe and billed to the right owner in minutes; we can show an auditor who changed what."
Pitfall. Starting with architecture diagrams.
Q50 How do you measure and prioritise a platform team's work?
Short answer. By outcomes for users and risk reduced, ranked by impact and effort.
Reasoning. Platform teams can drift into building what is interesting. Customer interviews, support requests and findings give priorities.
Example. Track lead time for a project, denied deployments by cause, drift count, and open critical findings; fund the largest source of friction.
Pitfall. Measuring activity such as projects created.
Question index
| No. | Topic | One-line answer key |
|---|---|---|
| Q38 | Urgent project | Factory or standard manual first, then code |
| Q39 | Policy blocks deploy | Read denial, scoped time-limited exception |
| Q40 | Leaked key | Contain, investigate, remove cause |
| Q41 | Bill doubled | Export by project, service, label |
| Q42 | Apply failed | Check state and lock, plan again |
| Q43 | Perimeter blocks pipeline | Violation log, narrow rule, dry run |
| Q44 | Regulated design | Locations, keys, perimeter, evidence |
| Q45 | 200 unmanaged projects | Inventory, stage, move in waves |
| Q46 | Disagreement | Data and trial |
| Q47 | Incident story | Own it, order, lasting change |
| Q48 | Owner request | Narrower role, time limit |
| Q49 | Executive explanation | Outcomes, not services |
| Q50 | Measuring a platform | User outcomes and risk, not activity |
Common faults in these answers
| Symptom in your answer | Likely cause | First fix |
|---|---|---|
| You jump to the fix | No containment habit | Open with "first I would contain" |
| No evidence step | Guessing instead of reading logs | Name the first read-only command |
| Story has no result | Details without outcome | End with a number or a changed process |
| Blaming others | Defensive framing | Describe the system gap instead |
| Over two minutes | No time discipline | Use the timer from the Lab tab |
Video links are search pages, not pinned videos. Check the date against the documentation you use.
- YouTube search: behavioural interviews and the STAR method
- YouTube search: Google Cloud incident response for a leaked key
- YouTube search: blameless postmortems
- YouTube search: Google Cloud architecture interview practice
Official reading: Best practices for managing service account keys · Landing zone design in Google Cloud · Google SRE books.
Command cheat sheet
Interview quick reference
Fifty questions, one line each. Answer in four moves: short answer, reasoning, a Google Cloud example, a pitfall. The full model answers are in modules 5 to 8 (Interview questions tab).
Q1 to Q13: landing-zone design (module 5)
| No. | Topic | One-line answer key |
|---|---|---|
| Q1 | What is a landing zone | Governed foundation every workload inherits; a product, not a project |
| Q2 | Folder structure | Mirror policy differences, start with three or four folders |
| Q3 | Project granularity | One project per application per environment, created by a factory |
| Q4 | Prod and non-prod | Separate folders and projects, stricter policy on the prod folder |
| Q5 | IAM versus Org Policy | Who may act versus what may be configured |
| Q6 | Central or delegated | Central guardrails, delegated freedom inside them |
| Q7 | Terraform stages | Bootstrap, organization, environments, networks, projects; own state and identity each |
| Q8 | Bootstrap problem | One controlled step creates seed project, state bucket and service accounts |
| Q9 | Naming, labels, tags | Fix names early; labels for cost; tags for policy and conditions |
| Q10 | Billing structure | Few accounts, budgets alert but do not cap, export for detail |
| Q11 | Regions and residency | Requirements first, enforce with gcp.resourceLocations |
| Q12 | Is it working | Lead time, policy violations, drift, findings trend |
| Q13 | Versus other clouds | Same ideas as Control Tower or Azure landing zones, assembled from blueprint and code |
Q14 to Q25: identity, networking and security (module 6)
| No. | Topic | One-line answer key |
|---|---|---|
| Q14 | Service account keys | Avoid; attached identity, impersonation, federation; block key creation |
| Q15 | Workload Identity Federation | Token exchange, attribute mapping and condition, roles/iam.workloadIdentityUser |
| Q16 | Least privilege | Groups, predefined roles, lowest scope, Recommender |
| Q17 | Conditions and deny | Conditions narrow, deny overrides, constraints limit configuration |
| Q18 | Shared VPC or peering | Central control versus separately administered networks |
| Q19 | Firewall policies | Org or folder level, evaluated first, goto_next delegates |
| Q20 | Private egress | Cloud NAT, Private Google Access, Private Service Connect |
| Q21 | VPC Service Controls | Perimeter against data exfiltration, dry run before enforcing |
| Q22 | CMEK | Customer-controlled keys, rotation, revocation, operational duty |
| Q23 | Secrets | Secret Manager, access by identity, per-secret grants |
| Q24 | HA VPN or Interconnect | VPN quick and encrypted; Interconnect for throughput; two of either for availability |
| Q25 | Day-one constraints | Keys, domains, locations, external IPs, OS Login, default network, uniform bucket access |
Q26 to Q37: operations, logging, cost and IaC (module 7)
| No. | Topic | One-line answer key |
|---|---|---|
| Q26 | Audit log types | Admin Activity always on; Data Access deliberately; System Event; Policy Denied |
| Q27 | Central logging | Organization sink with children, protected logging project |
| Q28 | Sink with no logs | Writer identity permission, filter, exclusion, destination |
| Q29 | Alerting | Few symptoms and key audit events, with owner and runbook |
| Q30 | Budgets | Alert, not cap; control by policy, quota and your own automation |
| Q31 | Billing export | BigQuery export plus labels set by the factory |
| Q32 | Terraform state | Remote bucket, versioning, locking, per stage, restricted access |
| Q33 | Project factory | Labels, billing, APIs, budgets, Shared VPC, deletion protection |
| Q34 | CI/CD | Plan on PR, apply the reviewed plan, keyless, one account per stage |
| Q35 | Drift | Scheduled plan -detailed-exitcode, exit 2 means changes |
| Q36 | Version pinning | Pin major, commit lock file, upgrade in non-prod first |
| Q37 | Asset Inventory | Search, export, feeds; not strictly real time |
Q38 to Q50: scenarios and behavioural (module 8)
| No. | Topic | One-line answer key |
|---|---|---|
| Q38 | Urgent project request | Right folder, standard settings, then code it |
| Q39 | Policy blocks deploy | Read denial and effective policy, scoped time-limited exception |
| Q40 | Leaked key | Disable, read audit log, remove the cause, enforce constraint |
| Q41 | Bill doubled | Export by project, service, label; then audit log for who |
| Q42 | Apply failed halfway | Read error, check state and lock, plan again |
| Q43 | Perimeter blocks pipeline | Violation log, narrow ingress rule, test in dry run |
| Q44 | Regulated workload | Locations, CMEK, perimeter, long-retention logs, evidence |
| Q45 | 200 unmanaged projects | Inventory, staging folder, move in waves |
| Q46 | Disagreement | Use data and a trial to decide |
| Q47 | Incident story | Own it, order of actions, lasting change |
| Q48 | Owner role request | Find the need, offer a narrower time-limited role |
| Q49 | Explain to executives | Outcomes: speed, risk, cost; no service names |
| Q50 | Measure a platform | User outcomes and risk reduced, not activity |
Commands worth knowing
Read-only unless marked. Placeholders are in capitals. Check gcloud … --help for the flags in your SDK version.
| Command | Purpose | Key flags | Gotcha |
|---|---|---|---|
gcloud organizations get-iam-policy ORG_ID | Who holds roles on the organization | --format | Needs resourcemanager.organizations.getIamPolicy |
gcloud resource-manager folders list | Folder layout | --organization, --folder | Empty output can mean no permission |
gcloud projects describe PROJECT_ID | Parent, labels, state | --format="yaml(parent,labels)" | Parent shows ID, not name |
gcloud projects get-iam-policy PROJECT_ID | Project bindings | --flatten, --filter | Does not show inherited bindings |
gcloud org-policies describe NAME --effective | Effective constraint after inheritance | --project, --folder | Form of the name differs by SDK version |
gcloud billing projects describe PROJECT_ID | Billing link | none | billingEnabled: false blocks many creates |
gcloud billing budgets list | Budgets on an account | --billing-account | Budgets alert, they do not cap |
gcloud iam service-accounts keys list | User-managed keys | --iam-account, --managed-by=user | Goal is zero keys |
gcloud iam workload-identity-pools providers describe | Federation mapping and condition | --workload-identity-pool, --location=global | Missing condition is too broad |
gcloud compute shared-vpc list-associated-resources | Service projects of a host | host project ID | Subnet access is separate (networkUser) |
gcloud compute firewall-policies list --organization=ORG_ID | Hierarchical policies | --organization, --folder | Priority order decides the result |
gcloud kms keys list | Keys, rotation, state | --location, --keyring | Disabled CMEK key breaks services |
gcloud logging read FILTER | Audit evidence | --freshness, --limit, --format | Data Access entries may be off |
gcloud logging sinks describe NAME | Sink filter and writer identity | --organization | Writer identity needs a destination role |
gcloud logging buckets list | Retention and lock | --location | A locked bucket cannot shorten retention |
gcloud asset search-all-resources | Inventory search | --scope, --query, --asset-types | Cloud Asset API must be enabled |
terraform plan -detailed-exitcode | Drift check | -out | Exit 2 means changes present |
gcloud iam service-accounts keys delete (write) | Contain a leaked key | --iam-account | Disable first, then delete |
Answer templates
| Question type | Template |
|---|---|
| Design or concept | Short answer, reasoning, Google Cloud example, pitfall. About 90 seconds. |
| Scenario | Contain, diagnose with evidence, fix in code, prevent, communicate. Name the first command. |
| Behavioural | Situation, action, result, lesson. About 2 minutes. No real employer details. |
| You do not know | State what you know, your assumption, and how you would verify in the documentation and a sandbox. |
Capstone lab and final quiz
Capstone: design a landing zone in 45 minutes
Goal. Produce a written landing-zone design for a fictional company, using only what you learned in the course, and score it with the rubric at the end. This is a design exercise: you create no cloud resources, so the cost is zero. Practise it as you would on a whiteboard in an interview, then compare your result with the self-check.
Prerequisites. Paper, a whiteboard or a text editor; a timer; the cheat sheet of this hour; and optionally a partner who plays the interviewer. Do not use any real company, customer or credential. Everything below is fictional, and any IDs you invent are illustrative.
The fictional company: Northwind Retail
| Fact | Detail |
|---|---|
| Business | Online retailer with a web shop, a stock system and a data analytics team |
| Teams | Six product teams, one data team, one platform team of four people, one security lead |
| Environments | Development, test and production for each product |
| Data | Customer data of European customers must stay in Europe; payment data is handled by a certified third party and never stored |
| Connectivity | One data centre with a warehouse system; a 1 Gbit/s link is expected in the second year |
| Starting point | A Cloud Identity domain exists, 35 unmanaged projects were created by engineers, one billing account is paid by finance |
| Constraints | No long-lived keys; finance wants cost per team; the auditor wants evidence of who changed what; the platform team wants changes through pull requests |
Deliverables
- Hierarchy diagram. Organization, folders and example projects, with where policy, IAM, logging and budgets apply.
- Identity and access table. Groups, roles, the break-glass account, and how pipelines authenticate.
- Guardrail list. At least eight Organization Policy constraints with the folder each applies to, and why.
- Network sketch. Shared VPC layout, firewall policy intent, egress, DNS, and the hybrid link choice with its reasons.
- Logging and cost plan. Sinks, retention, alerts, budgets, labels, billing export.
- Automation plan. Terraform stages, state, project factory, CI/CD identity, drift check.
- Risks and next steps. Three risks, three trade-offs, and what you would do in the first 30 days.
The 45-minute schedule
| Minutes | Step | What to do | Check |
|---|---|---|---|
| 0 to 5 | Clarify | List assumptions and questions you would ask. Write the layers: identity, hierarchy, policy, network, logging, cost, automation. | At least five assumptions are written down |
| 5 to 12 | Hierarchy and identity | Draw folders (platform, prod, nonprod, sandbox and a bring-in folder for the 35 projects). List groups and roles. | No individual users in the role table |
| 12 to 20 | Guardrails and keys | Choose constraints: iam.disableServiceAccountKeyCreation, iam.allowedPolicyMemberDomains, gcp.resourceLocations, compute.vmExternalIpAccess, compute.requireOsLogin, compute.skipDefaultNetworkCreation, storage.uniformBucketLevelAccess, sql.restrictPublicIp. | Each constraint has a folder and a reason |
| 20 to 28 | Network | Sketch host projects for prod and non-prod, subnets per region in Europe, hierarchical firewall policy intent, Cloud NAT, Cloud DNS, HA VPN first, Interconnect later. | IP ranges do not overlap with on-premises |
| 28 to 35 | Logging and cost | Organization sink with children, central logging project, retention, alerts on IAM changes and key creation, budgets per folder, billing export, mandatory labels. | You state that budgets alert and do not cap |
| 35 to 41 | Automation | Terraform stages, state bucket, project factory, plan on PR and apply after approval, Workload Identity Federation, drift check. | One identity per stage |
| 41 to 45 | Risks and review | Write three risks and the first 30 days. Score with the rubric. | Rubric total written |
Verification of each deliverable
If you have a sandbox organization, you may check the facts of your design with read-only commands. They are free. If you do not, skip this section.
- Compare your folders with a real listing:
gcloud resource-manager folders list --organization=ORG_ID. - Check how a real project is placed:
gcloud projects describe PROJECT_ID --format="yaml(parent,labels)". - Check the effective value of one constraint:
gcloud org-policies describe NAME --effective --project=PROJECT_ID(check--helpfor the name form in your SDK version). - Check central logging in your sandbox:
gcloud logging sinks list --organization=ORG_ID. - Check budgets:
gcloud billing budgets list --billing-account=BILLING_ACCOUNT_ID.
DISPLAY_NAME PARENT_NAME ID platform organizations/ORG_ID 111111111111 prod organizations/ORG_ID 222222222222 nonprod organizations/ORG_ID 333333333333
The output above is illustrative. Differences between your design and the sandbox are not errors; they are the first items of your "next steps".
Expected result: what a strong design contains
- A short hierarchy with a reason for each folder, and a staging folder to bring in the 35 existing projects in waves.
- Groups for every role, with Workload Identity Federation for pipelines and a constraint that blocks key creation.
- A location constraint for Europe on production folders, with a note about global services and log locations.
- Shared VPC with separate host projects for production and non-production, a central firewall policy, no external IPs by default, and a plan to add Interconnect only when throughput justifies it.
- An organization sink to a protected project, an alert on IAM changes, labels enforced by the project factory, budgets and billing export for cost per team.
- Terraform in stages with separate state and service accounts, a reviewed plan before every apply, and scheduled drift detection.
- Honest trade-offs: for example, more projects mean more governance work, solved by the factory.
Self-check rubric (total 40 points)
| Area | 2 points if | Points |
|---|---|---|
| Hierarchy | Folders follow policy differences and there is a plan for the 35 unmanaged projects | /4 |
| Identity | Groups only, break-glass account, keyless pipelines, least-privilege roles | /6 |
| Guardrails | At least eight constraints with scope and reason, rollout in stages | /6 |
| Network | Shared VPC, firewall policy, egress, DNS, hybrid decision justified, IP plan | /6 |
| Logging and cost | Central sink, retention, alerts, labels, budgets that alert, billing export | /6 |
| Automation | Stages, remote state, project factory, approval, drift check | /6 |
| Risks and communication | Three risks, three trade-offs, a 30-day plan, clear in under 10 minutes aloud | /6 |
Bands. 0 to 20: revisit hours 1 to 3 and the concepts tabs. 21 to 30: strengthen trade-offs and sequencing. 31 to 36: interview ready; practise delivery. 37 to 40: you can mentor others; repeat with a new fictional company.
Cost
Free. The exercise is on paper; the optional verification uses read-only commands.
Cleanup
None. Keep your design and score. Re-do the exercise in two weeks with a different fictional company (for example a regional bank with strict data residency) and compare the scores.
prj-shop-prod.Knowledge check
Sources and versions
Reference documentation for hour 8
Use the official documentation to check every fact you plan to state in an interview. Product behaviour, defaults and constraint names change; the pages below are the starting points for each topic in modules 5 to 8.
Landing zone and resource hierarchy
- Landing zone design in Google Cloud
- Enterprise foundations blueprint (security foundations guide)
- Resource hierarchy
- Organization Policy Service overview
- Organization policy constraints
Identity, network and security
- IAM overview
- Workload Identity Federation
- Best practices for managing service account keys
- Shared VPC
- Firewall policies overview
- Cloud NAT overview
- VPC Service Controls overview
- Customer-managed encryption keys
- Secret Manager overview
- Cloud VPN overview
- Cloud Interconnect overview
Logging, cost and inventory
- Cloud Audit Logs
- Configure and manage sinks
- Alerting overview
- Budgets and budget alerts
- Export Cloud Billing data to BigQuery
- Cloud Asset Inventory overview
Infrastructure as code
- Terraform on Google Cloud
- Store Terraform state in a Cloud Storage bucket
- Terraform example foundation (GitHub)
- google-github-actions/auth (GitHub)
- Terraform Google provider documentation
Command reference
Tools and versions used
| Tool | Version used in this hour | Note |
|---|---|---|
| gcloud CLI | Current release channel | Run gcloud version and gcloud components update; check gcloud … --help for the flags in your SDK version. |
| Terraform | 1.x with the Google provider | Pin the major version in required_providers and commit the lock file. |
| Cloud Shell | Managed by Google | Has gcloud and Terraform available; confirm the Terraform version before use. |
Check facts before an interview
- Open the documentation page for each topic you plan to mention and read its last-updated date.
- Run the read-only commands in a sandbox project and compare the output with what you say.
- If you are not sure, say so in the interview and describe how you would confirm it. That is a strength, not a weakness.
- Do not state prices, quotas or limits from memory. Say "I would check the current pricing page".
- Do not use real company, customer, project or credential names in answers or notes.
All links are external. Pages may move; if a link no longer works, search the title on cloud.google.com.