01 Run projects list command (Windows/macOS/Linux) with custom output filters to list the ID of each project available in your Google Cloud Platform (GCP) account:
gcloud projects list
--format="value(projectId)"
02 The command output should return the requested GCP project identifiers (IDs):
cc-project5-123123
cc-ai-project-123123
03 Run compute networks list command (Windows/macOS/Linux) with custom output filters to list the name of each VPC network created for the selected GCP project:
gcloud compute networks list
--project=cc-project5-123123
--format="value(name)"
04 The command output should return the requested VPC network names:
cc-project5-network
cc-custom-vpc-network
05 Run compute routers list command (Windows/macOS/Linux) to describe the name of the Compute Engine router (also known as Cloud Router) created for the specified VPC network. Cloud NAT uses Cloud Routers to group NAT configuration information:
gcloud compute routers list
--project=cc-project5-123123
--filter="network:(cc-project5-network)"
--format="value(name)"
06 The command output should return the name of the requested Cloud Router:
07 Run compute routers nats list command (Windows/macOS/Linux) to describe the Cloud NAT gateways deployed for the specified Cloud Router, in the selected VPC network:
gcloud compute routers nats list
--region=us-central1
--router=cc-project5-nat-router
--format="value(name)"
08 The command output should return the name of each NAT gateway deployed for your router:
cc-project5-nat-gateway
cc-web-platfom-nat-gateway
09 Run compute routers nats describe command (Windows/macOS/Linux) to describe the VPC subnets configured for the selected Cloud NAT gateway:
gcloud compute routers nats describe cc-project5-nat-gateway
--region=us-central1
--router=cc-project5-nat-router
--format="value(subnetworks[].name)"
10 The command output should return the URIs of the associated VPC subnets. If the compute routers nats describe command does not produce an output, there are no VPC subnets configured for the selected NAT gateway:
https://www.googleapis.com/compute/v1/projects/cc-project5-123123/regions/us-central1/subnetworks/cc-project5-subnet-001
https://www.googleapis.com/compute/v1/projects/cc-project5-123123/regions/us-central1/subnetworks/cc-project5-subnet-002
https://www.googleapis.com/compute/v1/projects/cc-project5-123123/regions/us-central1/subnetworks/cc-project5-subnet-003
11 Run compute networks subnets describe command (Windows/macOS/Linux) with custom output filters to describe the Private Google Access feature status for the specified VPC network:
gcloud compute networks subnets describe https://www.googleapis.com/compute/v1/projects/cc-project5-123123/regions/us-central1/subnetworks/cc-project5-subnet-001
--format="value(privateIpGoogleAccess)"
12 The command output should return the requested feature status (True for enabled, False for disabled):
If the
compute networks subnets describe command output returns
False, as shown in the example above, Private Google Access is disabled for the selected NAT-enabled VPC subnet.
13 Repeat steps no. 11 and 12 for each VPC subnet associated with the selected Cloud NAT gateway.
14 Repeat steps no. 9 - 13 for each NAT gateway deployed for the selected GCP project.
15 Repeat steps no. 3 – 14 for each GCP project available in your Google Cloud account.