Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Conceder os papéis necessários
O agente de serviço do Cloud Workstations permite que o Cloud Workstations execute tarefas de serviço no seu projeto. Quando você ativou
o serviço Cloud Workstations no seu projeto, o agente de serviço foi
criado automaticamente. Para permitir que o Cloud Workstations use sua rede e sub-rede de VPC compartilhada, conceda ao agente de serviço do Cloud Workstations do seu projeto o papel Usuário da rede do Compute Engine (roles/compute.networkUser) na sub-rede da VPC compartilhada.
Para recuperar o agente de serviço do Cloud Workstations do seu projeto, use o
comando a seguir:
Substitua WORKSTATIONS_PROJECT_ID pelo ID do
projeto em que você vai criar o cluster de estações de trabalho.
O agente de serviço do Cloud Workstations usa o seguinte formato: service-$WORKSTATIONS_PROJECT_NUMBER@gcp-sa-workstations.iam.gserviceaccount.com.
Conceda ao agente de serviço do Cloud Workstations o papel de Usuário da rede do Compute Engine (roles/compute.networkUser) na sub-rede da VPC compartilhada.
Criar clusters de estações de trabalho usando uma VPC compartilhada
Para informações gerais sobre o acesso à VPC compartilhada, consulte
VPC compartilhada
.
Ao criar um cluster de estação de trabalho, o Cloud Workstations associa o cluster
a uma sub-rede específica, e todas as estações de trabalho são colocadas nessa sub-rede. Para ativar os registros de fluxo de VPC, ative o registro em log para essa sub-rede. Para mais informações, consulte Ativar os registros de fluxo de VPC para uma sub-rede atual.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-11 UTC."],[],[],null,["# Set up Shared VPC access\n\nGrant the required roles\n------------------------\n\nThe [Cloud Workstations Service\nAgent](/workstations/docs/service-accounts#workstations-service-agent) allows\nCloud Workstations perform service duties on your project. When you activated\nthe Cloud Workstations Service in your project, the service agent was\nautomatically created. To enable Cloud Workstations to use your Shared VPC\nnetwork and subnetwork, grant the Cloud Workstations Service Agent for your\nproject the [Compute Engine Network User\nrole](/compute/docs/access/iam#compute.networkUser)\n(`roles/compute.networkUser`) on the Shared VPC subnet.\n\n1. To retrieve the Cloud Workstations Service Agent for your project, use the\n following command:\n\n gcloud beta services identity create \\\n --service=workstations.googleapis.com \\\n --project=\u003cvar translate=\"no\"\u003eWORKSTATIONS_PROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eWORKSTATIONS_PROJECT_ID\u003c/var\u003e with the ID of the\n project where you will create your workstations cluster.\n\n The Cloud Workstations Service Agent uses the following format: \n\n `service-`\u003cvar translate=\"no\"\u003e$WORKSTATIONS_PROJECT_NUMBER\u003c/var\u003e`@gcp-sa-workstations.iam.gserviceaccount.com`.\n2. Grant the Cloud Workstations Service Agent the [Compute Engine Network\n User role](/compute/docs/access/iam#compute.networkUser)\n (`roles/compute.networkUser`) role on the Shared VPC subnet.\n\nCreate workstation clusters using a Shared VPC\n----------------------------------------------\n\nWhen you [create your workstation\ncluster](/workstations/docs/create-configuration)\nin the Google Cloud console, specify the Shared VPC network and subnetwork.\nThis step is only possible if the subnet is shared with the user using the\nconsole. For more information, see [Provision\nShared VPC](/vpc/docs/provisioning-shared-vpc)\n.\n\nFor general information about Shared VPC access, see\n[Shared VPC](/vpc/docs/shared-vpc)\n.\n\nWhen you create a workstation cluster, Cloud Workstations associates the cluster\nwith a particular subnet and all workstations are placed in that subnet. To\nenable VPC Flow Logs, make sure that you turn on logging for\nthat subnet. For more information, see\n[Enable VPC Flow Logs for an existing subnet](/vpc/docs/using-flow-logs#enable-logging-existing).\n| **Tip:** When using Shared VPC, make sure that you add and configure firewall rules for the Shared VPC network. For more information, see [Configure firewall\n| rules](/workstations/docs/configure-firewall-rules) .\n\nWhat's next\n-----------\n\n- [Troubleshoot policy and access problems](/vpc/docs/troubleshooting-policy-and-access-problems)\n- [Configure VPC Service Controls and private clusters](/workstations/docs/configure-vpc-service-controls-private-clusters)\n- [Enable VPC Flow Logs](/vpc/docs/using-flow-logs#enabling-vpc-flow-logs)"]]