Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara mengirim traffic keluar (eksternal) dari layanan atau tugas Cloud Run
ke jaringan VPC Bersama, yang memungkinkan
akses ke instance VM Compute Engine, instance Memorystore, dan semua
resource lain dengan alamat IP internal
Menghubungkan ke jaringan VPC Bersama dapat dikonfigurasi dengan berbagai cara:
Traffic keluar VPC Langsung
Anda dapat menggunakan Traffic keluar VPC Langsung untuk mengirim traffic ke jaringan VPC Bersama
tanpa memerlukan konektor Akses VPC Serverless. Untuk menyiapkan traffic keluar (eksternal) tanpa konektor, lihat Traffic keluar VPC Langsung dengan jaringan VPC Bersama.
Konektor akses VPC Serverless
Jika perlu menggunakan konektor Akses VPC Tanpa Server, Anda dapat menyiapkannya
di project layanan VPC Bersama yang memiliki
resource Cloud Run yang membutuhkan akses ke jaringan Anda, atau Anda dapat
menyiapkan konektor bersama pada project host VPC Bersama. Setiap metode
memiliki keunggulannya masing-masing.
Project layanan
Manfaat membuat konektor di project layanan VPC Bersama:
Isolasi: Setiap konektor memiliki bandwidth khusus dan tidak terpengaruh oleh
penggunaan bandwidth konektor pada project layanan lainnya. Ini bagus apabila Anda
memiliki layanan yang mengalami lonjakan traffic, atau jika Anda perlu memastikan
bahwa setiap project layanan tidak terpengaruh oleh penggunaan konektor project layanan
lainnya.
Penagihan balik: Biaya yang dikeluarkan oleh konektor berkaitan dengan
project layanan yang berisi konektor tersebut. Hal ini memungkinkan penagihan balik yang lebih mudah.
Keamanan: Memungkinkan Anda mengikuti "prinsip hak istimewa terendah".
Konektor harus diberi akses ke resource di jaringan VPC
Bersama yang perlu dijangkau. Dengan membuat konektor di project
layanan, Anda dapat membatasi apa saja yang dapat diakses oleh layanan dalam project
menggunakan aturan firewall.
Independensi tim: Mengurangi dependensi pada administrator project host.
Tim dapat membuat dan mengelola konektor yang terkait dengan project
layanan mereka. Pengguna dengan peran Security Admin Compute Engine atau
peran Identity and Access Management (IAM) khusus dengan izin
compute.firewalls.create
yang diaktifkan untuk project host tetap harus mengelola aturan firewall untuk
konektor.
Manfaat membuat konektor di project host VPC Bersama:
Pengelolaan jaringan terpusat: Selaras dengan model VPC Bersama
pemusatan resource konfigurasi jaringan di project host.
Ruang alamat IP: Menghemat lebih banyak ruang alamat IP Anda. Konektor
memerlukan alamat IP untuk setiap instance, sehingga memiliki lebih sedikit konektor dan
lebih sedikit instance pada setiap konektor, akan menggunakan lebih sedikit alamat IP. Ini bagus apabila Anda
khawatir kehabisan alamat IP.
Pemeliharaan: Mengurangi pemeliharaan karena setiap konektor yang Anda buat dapat
digunakan oleh beberapa project layanan. Ini bagus jika Anda khawatir
tentang overhead pemeliharaan.
Biaya untuk waktu saat tidak ada aktivitas: Dapat mengurangi jumlah waktu saat tidak ada aktivitas konektor
dan biaya terkait. Konektor menimbulkan biaya meskipun tidak sedang menyajikan
traffic (lihat harga). Memiliki lebih sedikit
konektor dapat mengurangi jumlah resource yang Anda bayar saat tidak menyajikan
traffic, tergantung pada jenis konektor dan jumlah instance. Cara ini
sering kali hemat biaya apabila kasus penggunaan Anda melibatkan banyak layanan, dan
layanan tersebut jarang digunakan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-21 UTC."],[],[],null,["# Connect to a Shared VPC network\n\nThis page describes how to send egress (outbound) traffic from a Cloud Run\nservice or job to a [Shared VPC](/vpc/docs/shared-vpc) network, allowing\naccess to Compute Engine VM instances, Memorystore instances, and any\nother resources with an internal IP address.\n\nIf your organization does not use Shared VPC, see\n[Send traffic to a standard VPC network](/run/docs/configuring/connecting-vpc).\n\nComparison of configuration methods\n-----------------------------------\n\nConnecting to a Shared VPC network can be configured in different ways:\n\n#### Direct VPC egress\n\nYou can use Direct VPC egress to send traffic to a Shared VPC network\nwithout the need for Serverless VPC Access connectors. To set up egress\n(outbound) traffic without a connector, see\n[Direct VPC egress with a Shared VPC network](/run/docs/configuring/shared-vpc-direct-vpc).\n\n#### Serverless VPC Access connectors\n\nIf you need to use Serverless VPC Access connectors, you can set them\nup in [Shared VPC](/vpc/docs/shared-vpc) service projects that have\nCloud Run resources needing access to your network, or you can\nset up shared connectors in the Shared VPC host project. There are\nadvantages to each method. \n\n### Service projects\n\nAdvantages of creating connectors in the Shared VPC service projects:\n\n- **Isolation:** Each connector has dedicated bandwidth and is unaffected by bandwidth use of connectors in other service projects. This is good if you have a service that experiences spikes in traffic or if you need to ensure that each service project is unaffected by connector use of other service projects.\n- **Chargebacks:** Charges incurred by connectors are associated with the service project containing the connector. This enables easier chargebacks.\n- **Security:** Allows you to follow the \"principle of least privilege.\" Connectors must be granted access to the resources in your Shared VPC network that they need to reach. By creating a connector in the service project, you can limit what the services in the project can access by using firewall rules.\n- **Team independence:** Reduces dependency on the host project administrator. Teams can create and manage the connectors associated with their service project. A user with the Compute Engine [Security Admin](/compute/docs/access/iam#compute.securityAdmin) role or a custom [Identity and Access Management (IAM)](/iam) role with the [`compute.firewalls.create`](/compute/docs/reference/rest/v1/firewalls/insert#iam-permissions) permission enabled for the host project must still manage firewall rules for the connector.\n\nTo set up connectors in service projects, see\n[Configure connectors in service projects](/run/docs/configuring/shared-vpc-service-projects).\n\n### Host project\n\nAdvantages of creating connectors in the Shared VPC host project:\n\n- **Centralized network management:** Aligns with the Shared VPC model of centralizing network configuration resources in the host project.\n- **IP address space:** Preserves more of your IP address space. Connectors require an IP address for each instance, so having fewer connectors, and fewer instances in each connector, uses fewer IP addresses. This is good if you are concerned about running out of IP addresses.\n- **Maintenance:** Reduces maintenance because each connector you create can be used by multiple service projects. This is good if you are concerned about maintenance overhead.\n- **Cost for idle time:** Can reduce the amount of connector idle time and associated cost. Connectors incur costs even when they are not serving traffic (see [pricing](/vpc/pricing#serverless-vpc-pricing)). Having fewer connectors can reduce the amount of resources you pay for when not serving traffic, depending on your connector type and number of instances. This is often cost-effective if your use case involves a large number of services and the services are used infrequently.\n\nTo set up connectors in the host project, see\n[Configure connectors in the host project](/run/docs/configuring/shared-vpc-host-project).\n| **Tip:** For a side-by-side comparison, see [Compare Direct VPC egress and VPC connectors](/run/docs/configuring/connecting-vpc)."]]