0
0
GCPcloud~10 mins

Shared VPC concept in GCP - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Shared VPC concept
Host Project Created
Create VPC Network in Host
Attach Service Projects
Grant IAM Roles to Service Projects
Service Projects Use Shared VPC Resources
Resources Communicate Across Projects
End
This flow shows how a host project creates a VPC network, attaches service projects, grants permissions, and enables resource sharing across projects.
Execution Sample
GCP
1. Create host project
2. Create VPC network in host
3. Attach service project
4. Grant IAM roles
5. Deploy VM in service project using shared VPC
Steps to set up a Shared VPC where service projects use the host project's network.
Process Table
StepActionResultNotes
1Create host projectHost project createdThis project will own the VPC network
2Create VPC network in hostVPC network createdNetwork is isolated in host project
3Attach service projectService project linkedService project can use host's network
4Grant IAM rolesService project granted network user roleAllows service project to create resources in shared VPC
5Deploy VM in service projectVM uses shared VPC networkVM gets IP from host project's network
6VM communicates with other resourcesNetwork traffic flowsCross-project communication enabled
7EndSetup completeShared VPC is operational
💡 All steps completed; Shared VPC setup allows service projects to use host project's network resources.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5Final
Host ProjectNoneCreatedCreatedCreatedCreatedCreatedCreated
VPC NetworkNoneNoneCreatedCreatedCreatedCreatedCreated
Service ProjectNoneNoneNoneAttachedAttachedAttachedAttached
IAM RolesNoneNoneNoneNoneGrantedGrantedGranted
VM InstanceNoneNoneNoneNoneNoneDeployedDeployed
Key Moments - 3 Insights
Why can't service projects create their own VPC networks in a Shared VPC setup?
Service projects do not create their own VPCs; they use the host project's VPC network. This is shown in execution_table rows 2 and 3 where the VPC is created only in the host project and service projects are attached to it.
How does a VM in a service project get an IP address from the host project's network?
Because the service project has the 'network user' IAM role granted (row 4), it can deploy resources like VMs that use the host project's VPC network, as seen in row 5.
Can resources in service projects communicate with each other across projects?
Yes, once the Shared VPC is set up and VMs are deployed (rows 5 and 6), network traffic flows across projects using the shared network.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step is the service project linked to the host project?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Check the 'Action' column for 'Attach service project' in execution_table.
According to variable_tracker, when is the VM instance deployed?
AAfter Step 3
BAfter Step 4
CAfter Step 5
DAt Start
💡 Hint
Look at the 'VM Instance' row and see when it changes from 'None' to 'Deployed'.
If the IAM roles were not granted, what would happen at Step 5 in execution_table?
AVM deployment would fail due to lack of permissions
BVM would deploy successfully
CService project would be detached
DHost project would be deleted
💡 Hint
Refer to Step 4 and Step 5 in execution_table about IAM roles and VM deployment.
Concept Snapshot
Shared VPC lets multiple projects use one VPC network.
Host project owns the network.
Service projects attach to host and get permissions.
Resources in service projects use host's network.
Enables centralized network management across projects.
Full Transcript
Shared VPC is a Google Cloud concept where one project, called the host project, owns a Virtual Private Cloud (VPC) network. Other projects, called service projects, attach to this host project to use its network resources. The setup involves creating the host project, creating a VPC network inside it, attaching service projects, granting them network user roles, and then deploying resources like virtual machines in the service projects that use the shared network. This allows resources across projects to communicate securely and centrally managed. The execution table shows each step from creating projects to deploying VMs, and the variable tracker shows how key variables change over time. Key moments clarify common confusions about network ownership, permissions, and communication. The visual quiz tests understanding of the setup steps and permissions.