1. Introduzione
In questo codelab imparerai a eseguire il deployment di una connessione di servizio privato per AlloyDB e ad accedere al servizio AlloyDB utilizzando Private Service Connect di cui è stato eseguito il deployment.

Puoi trovare ulteriori informazioni su Private Service Connect qui.
Prerequisiti
- Una comprensione di base della console Google Cloud
- Competenze di base nell'interfaccia a riga di comando e in Google Cloud Shell
Cosa imparerai a fare
- Come eseguire il deployment di un cluster e di un'istanza AlloyDB
- Come eseguire il deployment di un Private Service Connect
- Come connettersi da una VM a un'istanza AlloyDB tramite Private Service Connect
Che cosa ti serve
- Un account Google Cloud e un progetto Google Cloud
- Un browser web come Chrome
2. Configurazione e requisiti
Configurazione dell'ambiente autonomo
- Accedi alla console Google Cloud e crea un nuovo progetto o riutilizzane uno esistente. Se non hai ancora un account Gmail o Google Workspace, devi crearne uno.



- Il nome del progetto è il nome visualizzato per i partecipanti a questo progetto. È una stringa di caratteri non utilizzata dalle API di Google. Puoi aggiornarlo in qualsiasi momento.
- L'ID progetto deve essere univoco in tutti i progetti Google Cloud ed è immutabile (non può essere modificato dopo essere stato impostato). La console Cloud genera automaticamente una stringa univoca, di solito non ti interessa di cosa si tratta. Nella maggior parte dei codelab, devi fare riferimento all'ID progetto (in genere è identificato come
PROJECT_ID). Se non ti piace l'ID generato, puoi generarne un altro casuale. In alternativa, puoi provare a crearne uno e vedere se è disponibile. Non può essere modificato dopo questo passaggio e rimarrà per tutta la durata del progetto. - Per tua informazione, esiste un terzo valore, un numero di progetto, utilizzato da alcune API. Scopri di più su tutti e tre questi valori nella documentazione.
Attenzione:un ID progetto è univoco a livello globale e non può essere utilizzato da altri dopo che lo hai selezionato. Sei l'unico utente di questo ID. Anche se un progetto viene eliminato, l'ID non può essere riutilizzato
- Successivamente, devi abilitare la fatturazione in Cloud Console per utilizzare le risorse/API Cloud. Completare questo codelab non costa molto, se non nulla. Per arrestare le risorse ed evitare addebiti oltre a quelli previsti in questo tutorial, puoi eliminare le risorse che hai creato o il progetto. I nuovi utenti di Google Cloud possono beneficiare del programma prova senza costi di 300$.
Avvia Cloud Shell
Sebbene Google Cloud possa essere gestito da remoto dal tuo laptop, in questo codelab utilizzerai Google Cloud Shell, un ambiente a riga di comando in esecuzione nel cloud.
Nella console Google Cloud, fai clic sull'icona di Cloud Shell nella barra degli strumenti in alto a destra:

Bastano pochi istanti per eseguire il provisioning e connettersi all'ambiente. Al termine, dovresti vedere un risultato simile a questo:

Questa macchina virtuale è caricata con tutti gli strumenti per sviluppatori di cui avrai bisogno. Offre una home directory permanente da 5 GB e viene eseguita su Google Cloud, migliorando notevolmente le prestazioni e l'autenticazione della rete. Tutto il lavoro in questo codelab può essere svolto all'interno di un browser. Non devi installare nulla.
3. Prima di iniziare
Abilita l'API
Tieni presente che alcune risorse che attivi comportano dei costi se non utilizzi il livello promozionale. In circostanze normali, se tutte le risorse vengono distrutte al termine del lab, il costo di tutte le risorse non supererà i 5 $. Ti consigliamo di controllare la fatturazione e assicurarti che l'esercizio sia accettabile per te.
In Cloud Shell, assicurati che l'ID progetto sia configurato:
Di solito, l'ID progetto viene mostrato tra parentesi nel prompt dei comandi in Cloud Shell, come mostrato nell'immagine:

gcloud config set project [YOUR-PROJECT-ID]
Verrà visualizzata una finestra che richiede l'autorizzazione di Cloud Shell. Fai clic su Autorizza.

Poi imposta la variabile di ambiente PROJECT_ID sull'ID del tuo progetto Google Cloud:
PROJECT_ID=$(gcloud config get-value project)
Imposta la variabile di ambiente REGION e ZONE sulla regione e sulla zona che preferisci:
REGION=europe-west4
ZONE=europe-west4-a
Attiva tutti i servizi necessari:
gcloud services enable compute.googleapis.com \
alloydb.googleapis.com \
dns.googleapis.com \
servicenetworking.googleapis.com \
iam.googleapis.com
Output previsto:
student@cloudshell:~ (psc-alloydb-test)$ gcloud services enable compute.googleapis.com \
alloydb.googleapis.com \
dns.googleapis.com \
servicenetworking.googleapis.com \
iam.googleapis.com
Operation "operations/acat.p2-981315804223-09b8112e-2c2c-4a30-9018-c27e6a06c199" finished successfully.
4. Eseguire il deployment di un cluster AlloyDB
In Cloud Shell puoi utilizzare la riga di comando per creare un nuovo cluster AlloyDB con Private Service Connect abilitato:
gcloud alloydb clusters create alloydb-cluster-01 \
--password=changeme \
--region=$REGION \
--project=$PROJECT_ID \
--enable-private-service-connect
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud alloydb clusters create alloydb-cluster-01 \
--password=changeme \
--region=$REGION \
--project=$PROJECT_ID \
--enable-private-service-connect
Operation ID: operation-1739367760591-62df21d80fae8-9aa7c3ab-64604bae
Creating cluster...done.
Ora crea un'istanza principale AlloyDB:
gcloud alloydb instances create alloydb-instance-01 \
--instance-type=PRIMARY \
--cpu-count=2 \
--availability-type=ZONAL \
--region=$REGION \
--cluster=alloydb-cluster-01 \
--project=$PROJECT_ID \
--allowed-psc-projects=$PROJECT_ID
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud alloydb instances create alloydb-instance-01 \
--instance-type=PRIMARY \
--cpu-count=2 \
--availability-type=ZONAL \
--region=$REGION \
--cluster=alloydb-cluster-01 \
--project=$PROJECT_ID \
--allowed-psc-projects=$PROJECT_ID
Operation ID: operation-1739368280521-62df23c7e7bda-7e52597c-8c7d9d79
Creating instance...done.
5. Configura Private Service Connect
Per le seguenti attività correlate alla rete, si presuppone che sia presente un VPC denominato default.
Prenotare un indirizzo IP interno
Trova l'intervallo CIDR della subnet VPC nella regione GCP a cui fa riferimento la variabile di ambiente REGION e scegli un indirizzo IP libero in questo intervallo CIDR per l'endpoint Private Service Connect:
gcloud compute networks subnets describe default \
--region=$REGION --project=$PROJECT_ID \
--format="value(ipCidrRange)"
Risultato previsto
student@cloudshell:~ (psc-cloud-sql-test)$ gcloud compute networks subnets describe default \
--region=$REGION --project=$PROJECT_ID \
--format="value(ipCidrRange)"
10.164.0.0/20
Riserva un indirizzo IP interno per l'endpoint Private Service Connect nell'intervallo CIDR della subnet VPC derivata sopra:
gcloud compute addresses create alloydb-psc \
--project=$PROJECT_ID \
--region=$REGION \
--subnet=default \
--addresses=10.164.0.10
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute addresses create alloydb-psc \ --project=$PROJECT_ID \ --region=$REGION \ --subnet=default \ --addresses=10.164.0.10 Created [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/addresses/alloydb-psc].
Verifica che l'indirizzo IP interno sia riservato e che lo stato RESERVED venga visualizzato per l'indirizzo IP.
gcloud compute addresses list --project=$PROJECT_ID \
--filter="name=alloydb-psc"
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute addresses list --project=$PROJECT_ID \ --filter="name=alloydb-psc" NAME: alloydb-psc ADDRESS/RANGE: 10.164.0.10 TYPE: INTERNAL PURPOSE: GCE_ENDPOINT NETWORK: REGION: europe-west4 SUBNET: default STATUS: RESERVED
Recupera l'URI del collegamento al servizio
Dopo aver creato un'istanza AlloyDB con Private Service Connect abilitato, recupera l'URI del collegamento al servizio e utilizzalo per creare l'endpoint Private Service Connect con l'indirizzo IP interno riservato sopra.
gcloud alloydb instances describe alloydb-instance-01 \
--cluster=alloydb-cluster-01 \
--region="$REGION" \
--format="value(pscInstanceConfig.serviceAttachmentLink)" | \
sed 's|.*/projects/|projects/|'
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud alloydb instances describe alloydb-instance-01 \
--cluster=alloydb-cluster-01 \
--region="$REGION" \
--format="value(pscInstanceConfig.serviceAttachmentLink)" | \
sed 's|.*/projects/|projects/|'
projects/se8c7a64d55e2e1f9p-tp/regions/europe-west4/serviceAttachments/alloydb-69f67b56-9fa-alloydb-instance-sa
Crea Private Service Connect
Crea l'endpoint Private Service Connect e indirizzalo all'URI del collegamento del servizio AlloyDB:
gcloud compute forwarding-rules create alloydb-psc-ep \
--address=alloydb-psc \
--project=$PROJECT_ID \
--region=$REGION \
--network=default \
--target-service-attachment=projects/se8c7a64d55e2e1f9p-tp/regions/europe-west4/serviceAttachments/alloydb-69f67b56-9fa-alloydb-instance-sa \
--allow-psc-global-access
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute forwarding-rules create alloydb-psc-ep \ --address=alloydb-psc \ --project=$PROJECT_ID \ --region=$REGION \ --network=default \ --target-service-attachment=projects/se8c7a64d55e2e1f9p-tp/regions/europe-west4/serviceAttachments/alloydb-69f67b56-9fa-alloydb-instance-sa \ --allow-psc-global-access Created [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/forwardingRules/alloydb-psc-ep].
Verifica che l'endpoint possa connettersi al collegamento al servizio:
gcloud compute forwarding-rules describe alloydb-psc-ep \
--project=$PROJECT_ID \
--region=$REGION \
--format="value(pscConnectionStatus)"
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute forwarding-rules describe alloydb-psc-ep \ --project=$PROJECT_ID \ --region=$REGION \ --format="value(pscConnectionStatus)" ACCEPTED
Configura una zona gestita di Cloud DNS
Per aggiungere il nome DNS suggerito per l'istanza AlloyDB, è consigliabile creare una zona DNS privata nella rete VPC corrispondente:
gcloud dns managed-zones create alloydb-dns \
--project=$PROJECT_ID \
--description="DNS zone for the AlloyDB instances" --dns-name=$REGION.alloydb-psc.goog. \
--networks=default \
--visibility=private
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud dns managed-zones create alloydb-dns \ --project=$PROJECT_ID \ --description="DNS zone for the AlloyDB instances" --dns-name=$REGION.alloydb-psc.goog. \ --networks=default \ --visibility=private Created [https://dns.googleapis.com/dns/v1/projects/psc-alloydb-test/managedZones/alloydb-dns].
Aggiungi un record DNS per Private Service Connect
Recupera il record DNS suggerito per l'istanza AlloyDB:
gcloud alloydb instances describe alloydb-instance-01 \
--cluster=alloydb-cluster-01 --region=$REGION --project=$PROJECT_ID \
--format="value(pscInstanceConfig.pscDnsName)"
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud alloydb instances describe alloydb-instance-01 \ --cluster=alloydb-cluster-01 --region=$REGION --project=$PROJECT_ID \ --format="value(pscInstanceConfig.pscDnsName)" 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog.
Aggiungi il record DNS suggerito alla zona DNS gestita
gcloud dns record-sets create 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog. \
--project=$PROJECT_ID \
--type=A \
--rrdatas=10.164.0.10 \
--zone=alloydb-dns
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud dns record-sets create 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog. \ --project=$PROJECT_ID \ --type=A \ --rrdatas=10.164.0.10 \ --zone=alloydb-dns NAME: 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog. TYPE: A TTL: 0 DATA: 10.164.0.10
6. Prepara la macchina virtuale Google Compute Engine
Deploy Google Compute Engine Virtual Machine
La macchina virtuale (VM) verrà utilizzata per connettersi all'istanza AlloyDB.
gcloud compute instances create alloydb-client \
--zone=$ZONE \
--create-disk=auto-delete=yes,boot=yes,image=projects/debian-cloud/global/images/$(gcloud compute images list --filter="family=debian-12 AND family!=debian-12-arm64" --format="value(name)") \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--shielded-secure-boot \
--network-interface=no-address
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute instances create alloydb-client \
--zone=$ZONE \
--create-disk=auto-delete=yes,boot=yes,image=projects/debian-cloud/global/images/$(gcloud compute images list --filter="family=debian-12 AND family!=debian-12-arm64" --format="value(name)") \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--network-interface=no-address
Created [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/zones/europe-west4-a/instances/alloydb-client].
NAME: alloydb-client
ZONE: europe-west4-a
MACHINE_TYPE: n1-standard-1
PREEMPTIBLE:
INTERNAL_IP: 10.164.0.2
EXTERNAL_IP:
STATUS: RUNNING
Installare il client Postgres
Crea un Cloud NAT per il traffico in uscita verso internet a cui la VM può accedere ai repository Linux:
gcloud compute routers create cloud-nat-router \
--network=default \
--region=$REGION
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute routers create cloud-nat-router \
--network=default \
--region=$REGION
Creating router [cloud-nat-router]...done.
NAME: cloud-nat-router
REGION: europe-west4
NETWORK: default
gcloud compute routers nats create cloud-nat \
--router=cloud-nat-router \
--region=$REGION \
--nat-all-subnet-ip-ranges \
--auto-allocate-nat-external-ips
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute routers nats create cloud-nat \
--router=cloud-nat-router \
--region=$REGION \
--nat-all-subnet-ip-ranges \
--auto-allocate-nat-external-ips
Creating NAT [cloud-nat] in router [cloud-nat-router]...done.
Installa il software client PostgreSQL sulla VM di cui è stato eseguito il deployment
Connettiti alla VM:
gcloud compute ssh --zone $ZONE "alloydb-client" --tunnel-through-iap --project $PROJECT_ID
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute ssh --zone $ZONE "alloydb-client" --tunnel-through-iap --project $PROJECT_ID WARNING: To increase the performance of the tunnel, consider installing NumPy. For instructions, please see https://cloud.google.com/iap/docs/using-tcp-forwarding#increasing_the_tcp_upload_bandwidth Warning: Permanently added 'compute.3358765012415130370' (ED25519) to the list of known hosts. Linux alloydb-client 6.1.0-29-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.123-1 (2025-01-02) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Creating directory '/home/student_tampferl_altostrat_com'.
Installa il comando di esecuzione del software all'interno della VM:
sudo apt-get update
sudo apt-get install --yes postgresql-client
Risultato previsto
sudo apt-get update sudo apt-get install --yes postgresql-client Get:1 file:/etc/apt/mirrors/debian.list Mirrorlist [30 B] Get:5 file:/etc/apt/mirrors/debian-security.list Mirrorlist [39 B] Get:7 https://packages.cloud.google.com/apt google-compute-engine-bookworm-stable InRelease [1321 B] Get:2 https://deb.debian.org/debian bookworm InRelease [151 kB] Get:3 https://deb.debian.org/debian bookworm-updates InRelease [55.4 kB] Get:4 https://deb.debian.org/debian bookworm-backports InRelease [59.0 kB] ...redacted... update-alternatives: using /usr/share/postgresql/15/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode Setting up postgresql-client (15+248) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for libc-bin (2.36-9+deb12u9) ...
7. Connettiti all'istanza AlloyDB per PostgreSQL tramite Private Service Connect
Connettiti all'istanza
psql "dbname=postgres user=postgres host=69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog."
Risultato previsto
student_tampferl_altostrat_com@alloydb-client:~$ psql "dbname=postgres user=postgres host=69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog." Password for user postgres: psql (15.10 (Debian 15.10-0+deb12u1), server 15.7) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off) Type "help" for help. postgres=>
Crea e testa il database
Crea un database
CREATE DATABASE company;
Risultato previsto
postgres=> CREATE DATABASE company; CREATE DATABASE postgres=>
Elenca tutti i database
\l
Risultato previsto
Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges
-----------------+------------------+----------+---------+-------+------------+-----------------+---------------------------------------
alloydbadmin | alloydbadmin | UTF8 | C | C | und-x-icu | icu |
alloydbmetadata | alloydbadmin | UTF8 | C | C | und-x-icu | icu | alloydbadmin=CTc/alloydbadmin +
| | | | | | | alloydbmetadata=c/alloydbadmin
company | postgres | UTF8 | C | C | und-x-icu | icu |
postgres | alloydbsuperuser | UTF8 | C | C | und-x-icu | icu |
template0 | alloydbadmin | UTF8 | C | C | und-x-icu | icu | =c/alloydbadmin +
| | | | | | | alloydbadmin=CTc/alloydbadmin
template1 | alloydbsuperuser | UTF8 | C | C | und-x-icu | icu | =c/alloydbsuperuser +
| | | | | | | alloydbsuperuser=CTc/alloydbsuperuser
(6 rows)
Connettersi al database dei dipendenti
\c company
Risultato previsto
postgres=> \c company psql (15.10 (Debian 15.10-0+deb12u1), server 15.7) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off) You are now connected to database "company" as user "postgres". company=>
Crea una tabella nel database aziendale
CREATE TABLE employees (
id SERIAL PRIMARY KEY,
first VARCHAR(255) NOT NULL,
last VARCHAR(255) NOT NULL,
salary DECIMAL (10, 2)
);
Risultato previsto
company=> CREATE TABLE employees (
id SERIAL PRIMARY KEY,
first VARCHAR(255) NOT NULL,
last VARCHAR(255) NOT NULL,
salary DECIMAL (10, 2)
);
CREATE TABLE
Inserisci i dati nella tabella dei dipendenti del database aziendale
INSERT INTO employees (first, last, salary) VALUES
('Max', 'Mustermann', 5000.00),
('Anna', 'Schmidt', 7000.00),
('Peter', 'Mayer', 6000.00);
Risultato previsto
company=> INSERT INTO employees (first, last, salary) VALUES
('Max', 'Mustermann', 5000.00),
('Anna', 'Schmidt', 7000.00),
('Peter', 'Mayer', 6000.00);
INSERT 0 3
company=>
Esegui query sulla tabella dei dipendenti
SELECT * FROM employees;
Risultato previsto
company=> SELECT * FROM employees; id | first | last | salary ----+-------+------------+--------- 1 | Max | Mustermann | 5000.00 2 | Anna | Schmidt | 7000.00 3 | Peter | Mayer | 6000.00 (3 rows) company=>
Esci dal database Postgres e dalla VM e torna a Cloud Shell:
\q
exit
Risultato previsto
company=> \q student_tampferl_altostrat_com@alloydb-client:~$ exit logout Connection to compute.3358765012415130370 closed. student@cloudshell:~ (psc-alloydb-test)$
8. Pulizia dell'ambiente
Elimina tutte le risorse Google Cloud nel progetto al termine del lab.
Elimina il cluster AlloyDB
In Cloud Shell elimina il cluster AlloyDB per PostgreSQL:
gcloud alloydb clusters delete alloydb-cluster-01 --region=$REGION --force --quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud alloydb clusters delete alloydb-cluster-01 --region=$REGION --force --quiet Operation ID: operation-1739488287386-62e0e2d75ead0-f8ffd91f-9c0f56c1 Deleting cluster...done.
Elimina la macchina virtuale Google Compute Engine
In Cloud Shell, elimina la VM:
gcloud compute instances delete alloydb-client \
--zone=$ZONE \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute instances delete alloydb-client \
--zone=$ZONE \
--quiet
Deleted [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/zones/europe-west4-a/instances/alloydb-client].
Eliminare i componenti di rete
Elimina i componenti correlati alla rete: Cloud NAT, Cloud Router, endpoint Private Service Connect, indirizzo IP interno riservato, record DNS e zona gestita DNS.
Elimina Cloud NAT:
gcloud compute routers nats delete cloud-nat \
--router=cloud-nat-router \
--region=$REGION \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute routers nats delete cloud-nat \
--router=cloud-nat-router \
--region=$REGION \
--quiet
Updated [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/routers/cloud-nat-router].
Elimina il router Cloud:
gcloud compute routers delete cloud-nat-router \
--region=$REGION \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute routers delete cloud-nat-router \
--region=$REGION \
--quiet
Deleted [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/routers/cloud-nat-router].
Elimina endpoint Private Service Connect:
gcloud compute forwarding-rules delete alloydb-psc-ep \
--project=$PROJECT_ID \
--region=$REGION \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute forwarding-rules delete alloydb-psc-ep \
--project=$PROJECT_ID \
--region=$REGION \
--quiet
Deleted [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/forwardingRules/alloydb-psc-ep].
Rilascia l'indirizzo IP interno prenotato:
gcloud compute addresses delete alloydb-psc \
--project=$PROJECT_ID \
--region=$REGION \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud compute addresses delete alloydb-psc \ --project=$PROJECT_ID \ --region=$REGION \ --quiet Deleted [https://www.googleapis.com/compute/v1/projects/psc-alloydb-test/regions/europe-west4/addresses/alloydb-psc].
Elimina record DNS:
gcloud dns record-sets delete 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog. \
--project=$PROJECT_ID \
--type=A \
--zone=alloydb-dns
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud dns record-sets delete 69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog. \ --project=$PROJECT_ID \ --type=A \ --zone=alloydb-dns Deleted [https://dns.googleapis.com/dns/v1/projects/psc-alloydb-test/managedZones/alloydb-dns/rrsets/69f67b56-9fa2-4480-89f6-3f1a38ee51cb.6a495301-4802-4ec1-bb9b-69b57d2616ec.europe-west4.alloydb-psc.goog./A].
Elimina zona gestita DNS:
gcloud dns managed-zones delete alloydb-dns \
--project=$PROJECT_ID \
--quiet
Risultato previsto
student@cloudshell:~ (psc-alloydb-test)$ gcloud dns managed-zones delete alloydb-dns \ --project=$PROJECT_ID \ --quiet Deleted [https://dns.googleapis.com/dns/v1/projects/psc-alloydb-test/managedZones/alloydb-dns].
9. Complimenti
Congratulazioni per aver completato il codelab.
Argomenti trattati
- Come eseguire il deployment di un cluster e di un'istanza AlloyDB
- Come eseguire il deployment di un Private Service Connect
- Come connettersi da una VM a un'istanza AlloyDB tramite Private Service Connect