Deploying Networking & Infrastructure as Code
Google ACE ACE · Planning and implementing a cloud solution
VPC networks: the basics
A Virtual Private Cloud (VPC) network is the software-defined network for your Google Cloud resources. Unlike the other major clouds, a Google Cloud VPC is global: a single VPC spans all regions, and its subnets are regional. That means a VM in europe-west2 and a VM in us-central1 can be on the same VPC and communicate over Google's private network without any peering or VPN between regions. Each project starts with a default VPC (auto mode, with a subnet in every region and permissive firewall rules), but production environments should use a custom VPC designed for the workload.
VPCs come in two subnet modes. An auto mode VPC automatically creates one subnet per region with a predefined IP range — convenient for getting started, inflexible for production. A custom mode VPC has no subnets until you create them, and you choose each subnet's region and IP range yourself — this is the recommended mode for real workloads, because it lets you control address space and avoid overlapping ranges with on-premises networks. A subnet's IP range can be expanded later but never shrunk, and a subnet cannot be moved to another region. Every project can have multiple VPCs, and a VM's network interface attaches to one subnet in one VPC (VMs can have additional interfaces on other VPCs).
Shared VPC
Shared VPC lets multiple projects share a single VPC network owned by a host project. Service projects attach to the host project's VPC and deploy resources into its subnets, while the central networking team keeps control of the network configuration, firewall rules, and IP addressing. Shared VPC is the answer when a question describes centralized network administration across many projects: one team owns the network, many teams use it, and each team's resources stay in its own project for billing and IAM separation. The alternative — a separate VPC per project with peering between them — is harder to manage at scale and is not the recommended pattern for this requirement.
Firewall rules and policies
Google Cloud firewall rules control traffic to and from VM instances, and they are stateful: if an ingress connection is allowed, the return traffic is allowed automatically. Rules are defined at the VPC level and apply to instances through targets — all instances in the network, instances with a specific network tag, or instances running as a specific service account. Each rule has a direction (ingress for incoming traffic, egress for outgoing), a priority (lower number wins; the default is 1000), an action (allow or deny), and a source or destination (IP ranges, or the network itself). When a packet matches multiple rules, the lowest-priority-numbered rule wins; if no rule matches, the implied rules apply — implied allow for egress, implied deny for ingress.
Two practical points matter for the exam. First, targeting by service account is more robust than targeting by network tag: tags are just labels on a VM that anyone with the right role can change, while a service account is an identity tied to the workload. A rule that allows traffic to the service account of the database VMs is harder to bypass than one that allows traffic to VMs tagged "database". Second, firewall policies (hierarchical firewall policies) let administrators set rules at the organization or folder level that apply to all VPCs beneath them — the same inheritance idea as the resource hierarchy, applied to firewalls. The exam also tests the implied rules: a VM cannot be reached from the internet unless an ingress rule allows it, which is why a new VM is not reachable on port 80 until you create a firewall rule for it.
Connecting networks: VPN and peering
Two services connect a VPC to networks outside Google Cloud or to other VPCs. Cloud VPN creates an encrypted IPsec tunnel between a VPC and an on-premises network (or another cloud) over the public internet. It comes in two forms: Classic VPN (a single tunnel, with static or dynamic routing) and HA VPN (two tunnels with automatic failover, 99.99% availability SLA — the recommended choice for production). VPC Network Peering connects two VPC networks privately, so resources in one can communicate with resources in the other using internal IP addresses. Peering is non-transitive: if VPC A peers with B and B peers with C, A cannot reach C through B. Peering is also the way to connect VPCs in different projects or organizations when Shared VPC is not suitable. The exam's key distinction: VPN connects to on-premises over the internet with encryption; peering connects VPCs to each other privately; and Cloud Interconnect (Dedicated or Partner) is the direct, private physical connection for high-bandwidth, low-latency hybrid connectivity — more expensive, not an internet tunnel.
Infrastructure as code
Infrastructure as code (IaC) means defining cloud resources in configuration files rather than creating them by clicking in the console. The exam guide lists four tools: Terraform (the most widely used, with a Google Cloud provider), Cloud Foundation Toolkit (Google's set of reusable Terraform modules and blueprints), Config Connector (which lets you manage Google Cloud resources through Kubernetes manifests), and Helm (which packages Kubernetes applications). For the ACE exam, the essential idea is what IaC gives you: repeatable deployments, version-controlled infrastructure, reviewable changes, and the ability to recreate an environment from scratch. If a question describes a team that deploys the same environment repeatedly, or needs to review infrastructure changes before applying them, the answer involves IaC — usually Terraform. The exam does not test Terraform syntax in depth; it tests knowing when IaC is the right approach and which tool fits which job.
Cloud Router and dynamic routing
Cloud Router is Google Cloud's managed BGP router: it exchanges routes dynamically between a VPC and an on-premises network (over Cloud VPN or Cloud Interconnect), so that each side learns the other's routes automatically instead of relying on static routes that must be maintained by hand. When a new subnet is added to the VPC, Cloud Router advertises it to the on-premises network; when a new prefix appears on-premises, it is advertised into the VPC. Cloud Router is required for HA VPN and for dynamic routing on Interconnect, and it is the answer whenever a question describes routes that should update automatically as networks change. The alternative — static routes — works for small, stable topologies but becomes unmanageable as networks grow, and the exam treats dynamic routing via Cloud Router as the better answer for hybrid connectivity at any real scale.
A related service worth knowing is Private Service Connect, which lets a VPC access Google services (such as Cloud Storage or BigQuery) or a partner's service through a private IP address inside the VPC, without the traffic crossing the public internet. It is the modern replacement for Private Google Access in many designs, and the answer when a question requires private connectivity to Google APIs from VMs without external IPs. Combined with Cloud NAT for outbound internet and Cloud DNS private zones for internal naming, it completes the picture of a VPC that is fully private yet fully functional — the architecture the exam rewards for security-sensitive workloads.
Exam traps to watch for
- Assuming a VPC is regional: Google Cloud VPCs are global, and subnets are the regional component.
- Using network tags when the question wants robust targeting: service accounts are identities and cannot be relabeled by a VM owner.
- Expecting VPC peering to be transitive: peered networks cannot forward traffic to a third network.
- Creating resources by hand when the scenario needs repeatable, reviewable deployments: that is what infrastructure as code is for.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.A company wants one central networking team to manage the VPC, firewall rules, and IP ranges, while application teams deploy resources into that network from their own projects. Which design fits?
Explanation: Shared VPC is designed for exactly this: the host project owns the network and its configuration, while service projects deploy resources into its subnets, keeping billing and IAM separation per team. Separate VPCs with peering would fragment network management. Putting everything in one project loses per-team isolation. VPN tunnels connect to external networks, not projects.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — creating a VPC with subnets (Shared VPC)
Q2.A new VM is running, but users cannot reach its web server on port 80 from the internet. The VM has an external IP address. What is the most likely cause?
Explanation: Google Cloud firewall rules deny all ingress by default (the implied deny ingress rule), so a new VM is unreachable from the internet until an ingress rule allows the port. The zone does not affect reachability. Machine type affects performance, not connectivity. Subnet mode affects IP range management, not firewall behavior.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — creating ingress and egress firewall rules and policies
Q3.A firewall rule should allow traffic only to the VMs that run the database, and the rule must keep working even if someone changes a VM's labels. What is the most robust way to target the rule?
Explanation: Service accounts are identities attached to VMs at creation, and firewall rules can target them — a VM owner cannot change a VM's service account to dodge a rule the way they can change a network tag. Targeting all instances is far too broad. IP ranges are brittle as VMs are created and destroyed. Network tags are simple labels that can be added or removed, making them the least robust targeting method.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — creating ingress and egress firewall rules and policies (network tags, service accounts)
Q4.A company needs to connect its on-premises data center to Google Cloud with an encrypted connection over the internet, with automatic failover if one tunnel goes down. Which service should they use?
Explanation: HA VPN creates two IPsec tunnels over the internet with automatic failover and a 99.99% availability SLA — matching the requirement exactly. VPC peering connects VPCs to each other, not to on-premises networks. Dedicated Interconnect is a private physical connection, not an internet tunnel. Classic VPN has a single tunnel and no 99.99% SLA.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — peering external networks (Cloud VPN)
Q5.Three VPC networks are peered in a chain: VPC A peers with VPC B, and VPC B peers with VPC C. Can a VM in VPC A communicate with a VM in VPC C through VPC B?
Explanation: VPC Network Peering is non-transitive by design: traffic cannot pass through a peered network to reach a third network. A and C would need a direct peering (or another connectivity solution) to communicate. Cloud Router exchanges routes for VPN and Interconnect; it does not make peering transitive. Peering works across projects and organizations.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — peering external networks (VPC Network Peering)
Q6.A team deploys the same three-tier environment (VPC, VMs, database) for each new customer, and the process is slow and error-prone when done by hand in the console. What should they adopt?
Explanation: Infrastructure as code defines the environment in files that can be version-controlled, reviewed, and applied identically every time — removing the manual errors of console clicking. More console users does not fix the repeatability problem. Larger VMs are unrelated to deployment process. A bigger VPC does not automate anything.
Exam objective: ACE exam guide 2.4: Planning and implementing resources using tooling — infrastructure as code tooling (Terraform)
Q7.Which statement about Google Cloud VPC networks is correct?
Explanation: Google Cloud VPCs are global resources spanning all regions; subnets are regional, each belonging to one region. A project can have multiple VPC networks, and a VPC is not limited to a zone.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — creating a VPC with subnets
Q8.A team creates a custom mode VPC for a production application. What must they do before they can launch a VM in it?
Explanation: Custom mode VPCs start with no subnets — you must create a subnet in the target region before a VM can attach to the network. Auto mode VPCs are the ones with a subnet per region. The Compute Engine API must be enabled, but that alone does not create a subnet. Peering with the default VPC is unnecessary and does not provide a subnet in the custom VPC.
Exam objective: ACE exam guide 2.3: Planning and implementing networking resources — creating a VPC with subnets (custom mode VPC)