Appendix F

Command-Line Reference

Scope. Every gcloud command this book uses, grouped by task, with the flags that carry a security decision and the section that uses it. The invocation, not the explanation. Prerequisites. None. Each entry's section reference is where the command is explained. Verified against. Google Cloud console and API surface as of 2026-09, Cloud SDK 583.0.0; every command path and every flag below re-resolved against the installed SDK; see sources at end.

The book runs 1,063 gcloud invocations across its chapters and appendices. This appendix is the 196 distinct commands worth looking up, sorted by task rather than by the chapter that happened to need them first.

Read the flag column as "the flags that decide something", not as a synopsis. Most real invocations in the book are longer than a printed line — 297 of the 348 in-book occurrences of these commands exceed 100 characters — so a full command with all its arguments belongs in the section that shows it, and that is what the § column is for. The commands here are gcloud only: the book contains no gsutil, bq, or kubectl invocation in a runnable block.

Two entries use a Preview surface and are labeled where they appear. gcloud beta terraform vet has a GA alternative, gcloud scc iac-validation-reports create, and §22.12 owns that choice; a Preview surface must never be a production dependency.

F.1 gcloud Configuration §

The only section here with no provenance in the book: these are the commands you run before any of the others, and the book never has to show them because every chapter assumes a configured SDK. The section references therefore point at the nearest owning section rather than at a section that runs the command, and that is worth knowing before you follow one. Two habits are worth forming early. Set the project once with gcloud config set rather than passing --project on every invocation, because a forgotten --project is how a command lands in the wrong estate. And keep separate named configurations for the SaaS and enterprise organizations, so switching between them is explicit rather than a matter of remembering which one is active.

CommandFlags that carry the decision§
gcloud components list§1.9
gcloud config configurations activate§2.15
gcloud config configurations create§2.15
gcloud config configurations list§2.15
gcloud config get§2.9
gcloud config list§1.9
gcloud config set§2.9
gcloud config unset§2.9
gcloud info§1.9

F.2 Authentication §

Identity setup and the impersonation chain. Note what is absent: nothing here downloads a service account key, because the estate forbids them (§3.25). gcloud auth activate-service-account is listed only so it is recognized as the anti-pattern it is.

CommandFlags that carry the decision§
gcloud auth activate-service-account§3.25
gcloud auth application-default login§26.3
gcloud auth configure-docker§24.2
gcloud auth list§3.3
gcloud auth login§3.3
gcloud auth print-access-token§3.24
gcloud auth print-identity-token§10.15
gcloud auth revoke§34.5
gcloud iam service-accounts add-iam-policy-binding--member, --role§3.24
gcloud iam service-accounts create--description, --display-name§3.5
gcloud iam service-accounts disable§34.5
gcloud iam service-accounts keys delete§34.5
gcloud iam service-accounts keys list--iam-account, --managed-by§3.25
gcloud iam workforce-pools create--description, --display-name, --location, --organization§4.2
gcloud iam workforce-pools providers create-oidc--attribute-mapping, --client-id, --issuer-uri, --location§4.2
gcloud iam workload-identity-pools create--display-name, --location§4.3
gcloud iam workload-identity-pools providers create-aws--account-id, --attribute-condition, --attribute-mapping, --location§4.10
gcloud iam workload-identity-pools providers create-oidc--allowed-audiences, --attribute-condition, --attribute-mapping, --issuer-uri§4.5
gcloud iam workload-identity-pools providers describe--location, --workload-identity-pool§4.4

F.3 Project Management §

The hierarchy: organizations, folders, projects, and the policy that hangs off each. gcloud projects update accepts only --name; a label change on an existing project goes through Terraform or the API (§2.12).

CommandFlags that carry the decision§
gcloud asset export--content-type, --organization, --output-path, --snapshot-time§29.6
gcloud asset search-all-resources--asset-types, --query, --read-mask, --scope§29.6
gcloud billing accounts list§2.5
gcloud billing projects link--billing-account§2.5
gcloud organizations describe§2.3
gcloud organizations list§2.7
gcloud projects create--folder, --labels, --name, --no-enable-cloud-apis§2.9
gcloud projects delete§2.29
gcloud projects describe§2.29
gcloud projects undelete§2.29
gcloud resource-manager folders create--display-name, --folder§2.8
gcloud resource-manager tags bindings create--parent, --tag-value§2.13
gcloud resource-manager tags keys create--description, --parent, --purpose, --purpose-data§2.13
gcloud services enable§1.9
gcloud services list--enabled§1.9

F.4 IAM §

Roles, bindings, conditions, and deny policies. The asymmetry to remember is that add-iam-policy-binding is additive and safe to script, while set-iam-policy is authoritative and will silently remove any binding not in the file you pass.

CommandFlags that carry the decision§
gcloud asset analyze-iam-policy--analyze-service-account-impersonation, --identity, --organization, --permissions§3.15
gcloud asset search-all-iam-policies--asset-types, --query, --scope§3.32
gcloud iam policies create--attachment-point, --kind, --policy-file§3.17
gcloud iam roles create--file, --organization§3.12
gcloud iam roles list§3.9
gcloud iam simulator replay-recent-access§3.16
gcloud iap web add-iam-policy-binding--member, --resource-type, --role, --service§7.17
gcloud organizations add-iam-policy-binding--member, --role§2.4
gcloud organizations get-iam-policy--flatten§3.13
gcloud pam entitlements create--entitlement-file, --folder, --location, --organization§3.27
gcloud pam grants create--entitlement, --folder, --justification, --location§3.27
gcloud policy-troubleshoot iam--permission, --principal-email§3.18
gcloud projects add-iam-policy-binding--condition, --condition-from-file, --member, --role§3.16
gcloud projects get-iam-policy--flatten§3.13
gcloud projects remove-iam-policy-binding--member, --role§3.16
gcloud projects set-iam-policy§3.13
gcloud recommender recommendations list--location, --recommender§3.31

F.5 Compute §

Instances, disks, images, and snapshots. The flags that carry security decisions are the shielded-VM and confidential-computing ones, and --no-address, which is what keeps an instance off the public internet.

CommandFlags that carry the decision§
gcloud compute disks create--kms-key, --provisioned-iops, --provisioned-throughput, --size§8.23
gcloud compute disks snapshot--guest-flush, --snapshot-names, --storage-location, --zone§8.26
gcloud compute images create--family, --guest-os-features, --kms-key, --source-disk§8.8
gcloud compute instance-groups managed create--health-check, --initial-delay, --instance-redistribution-type, --region§8.11
gcloud compute instance-groups managed rolling-action start-update--max-surge, --max-unavailable, --minimal-action, --most-disruptive-allowed-action§8.11
gcloud compute instance-templates create--boot-disk-kms-key, --boot-disk-type, --confidential-compute-type, --image-family§8.10
gcloud compute instances create--no-address, --scopes, --service-account, --shielded-integrity-monitoring§8.35
gcloud compute instances describe--zone§8.16
gcloud compute instances list--impersonate-service-account§8.1
gcloud compute instances suspend§34.7
gcloud compute instances update--shielded-learn-integrity-policy, --shielded-secure-boot, --zone§8.16
gcloud compute os-config os-policy-assignments create--file, --location§8.31
gcloud compute os-config patch-deployments create--file§8.30
gcloud compute resource-policies create snapshot-schedule--daily-schedule, --max-retention-days, --on-source-disk-delete, --region§8.27
gcloud compute ssh--internal-ip, --ssh-key-expire-after, --tunnel-through-iap, --zone§8.20
gcloud compute start-iap-tunnel--local-host-port, --zone§8.21

F.6 Networking §

The largest section, because the network surface is the largest. Two command groups are easy to confuse and are not interchangeable: compute firewall-policies is hierarchical, taking --organization or --folder, while compute network-firewall-policies is VPC-scoped and takes --global or --region (§5.31).

CommandFlags that carry the decision§
gcloud certificate-manager certificates create--dns-authorizations, --domains§7.9
gcloud compute addresses create--addresses, --description, --global, --network§5.18
gcloud compute backend-services create--connection-draining-timeout, --enable-logging, --global, --global-health-checks§7.3
gcloud compute backend-services update--cache-mode, --client-ttl, --connection-draining-timeout, --custom-request-header§7.6
gcloud compute firewall-policies rules create--action, --description, --direction, --enable-logging§5.14
gcloud compute firewall-rules create--action, --destination-ranges, --direction, --enable-logging§5.13
gcloud compute firewall-rules list§5.13
gcloud compute interconnects attachments dedicated create--bandwidth, --enable-admin, --interconnect, --mtu§6.5
gcloud compute network-firewall-policies export-rules--destination, --global§5.15
gcloud compute network-firewall-policies rules create--action, --dest-ip-ranges, --direction, --enable-logging§5.15
gcloud compute networks create--bgp-routing-mode, --description, --enable-ula-internal-ipv6, --internal-ipv6-range§5.2
gcloud compute networks subnets create--enable-flow-logs, --enable-private-ip-google-access, --ipv6-access-type, --logging-aggregation-interval§5.4
gcloud compute networks subnets list§5.4
gcloud compute networks subnets update--enable-private-ip-google-access, --region§5.17
gcloud compute routers add-bgp-peer--advertised-route-priority, --bfd-min-receive-interval, --bfd-min-transmit-interval, --bfd-multiplier§6.8
gcloud compute routers create--advertisement-mode, --asn, --network, --region§5.20
gcloud compute routers nats create--enable-dynamic-port-allocation, --enable-logging, --log-filter, --max-ports-per-vm§5.20
gcloud compute routes create--destination-range, --network, --next-hop-ilb, --next-hop-ilb-region§5.11
gcloud compute security-policies create--description, --global, --type§7.13
gcloud compute security-policies rules create--action, --ban-duration-sec, --conform-action, --description§7.13
gcloud compute security-policies update--enable-layer7-ddos-defense, --json-parsing, --layer7-ddos-defense-rule-visibility, --log-level§19.1
gcloud compute shared-vpc enable§5.27
gcloud compute ssl-policies create--global, --min-tls-version, --profile§7.10
gcloud compute target-https-proxies create--certificate-map, --global, --ssl-policy, --tls-early-data§7.3
gcloud compute url-maps create--default-service, --global§7.3
gcloud compute vpn-gateways create--network, --region, --stack-type§6.2
gcloud compute vpn-tunnels create--ike-version, --interface, --peer-external-gateway, --peer-external-gateway-interface§6.3
gcloud dns managed-zones create--description, --dns-name, --dnssec-state, --forwarding-targets§5.22
gcloud dns policies create--alternative-name-servers, --description, --enable-inbound-forwarding, --enable-logging§5.23
gcloud network-connectivity hubs create--description, --preset-topology§5.26
gcloud network-management connectivity-tests create--destination-ip-address, --destination-port, --protocol, --round-trip§6.19

F.7 GKE §

Cluster and node-pool lifecycle. Most of the hardening surface is on clusters create and cannot be changed afterward without recreating the cluster or the node pool (§9.30).

CommandFlags that carry the decision§
gcloud container clusters create--cluster-secondary-range-name, --confidential-node-type, --default-max-pods-per-node, --enable-authorized-networks-on-private-endpoint§9.8
gcloud container clusters create-auto--region, --release-channel§9.3
gcloud container clusters describe--region§9.30
gcloud container clusters get-credentials--region§9.13
gcloud container clusters update--binauthz-evaluation-mode, --database-encryption-key, --enable-fleet, --enable-master-authorized-networks§9.10
gcloud container fleet policycontroller enable--location, --memberships§9.39
gcloud container get-server-config§9.35
gcloud container node-pools create--cluster, --enable-autorepair, --enable-autoupgrade, --machine-type§9.5
gcloud container node-pools describe--cluster, --region§9.31
gcloud container node-pools update--cluster, --region, --workload-metadata§9.11

F.8 Cloud Run §

Services, jobs, and the invoker binding that decides who can call them. --no-allow-unauthenticated exists on run deploy and not on run services update, so hardening a service that is already public means removing the invoker binding (§10.13).

CommandFlags that carry the decision§
gcloud builds get-default-service-account--region§23.6
gcloud builds triggers create github--branch-pattern, --build-config, --description, --included-files§23.2
gcloud builds worker-pools create--no-public-egress, --peered-network, --peered-network-ip-range, --region§23.5
gcloud compute networks vpc-access connectors create--max-instances, --min-instances, --network, --range§10.20
gcloud deploy apply--file, --region§25.1
gcloud deploy releases create--delivery-pipeline, --description, --images, --region§25.3
gcloud deploy targets rollback--delivery-pipeline, --description, --region, --release§25.9
gcloud run deploy--binary-authorization, --concurrency, --image, --ingress§10.2
gcloud run jobs create--image, --max-retries, --parallelism, --region§10.3
gcloud run services add-iam-policy-binding--member, --region, --role§10.12
gcloud run services describe--region§10.2
gcloud run services get-iam-policy--region§10.14
gcloud run services update--add-cloudsql-instances, --binary-authorization, --clear-vpc-connector, --concurrency§10.7
gcloud run services update-traffic--region, --set-tags, --to-latest, --to-tags§10.25

F.9 Storage §

Buckets and objects. Note that gcloud storage buckets create has no --versioning flag; versioning, retention, and log routing are all set on update (§11.14).

CommandFlags that carry the decision§
gcloud artifacts docker images describe--show-package-vulnerability, --show-provenance, --show-sbom-references§23.13
gcloud artifacts docker images scan--location§24.6
gcloud artifacts repositories add-iam-policy-binding--location, --member, --role§24.4
gcloud artifacts repositories create--description, --immutable-tags, --kms-key, --location§24.1
gcloud artifacts repositories set-cleanup-policies--dry-run, --location, --policy§24.12
gcloud backup-dr backup-vaults create--access-restriction, --backup-min-enforced-retention, --location§29.9
gcloud storage buckets add-iam-policy-binding--condition-from-file, --member, --role§11.8
gcloud storage buckets create--default-encryption-key, --default-storage-class, --location, --placement§11.2
gcloud storage buckets describe§11.2
gcloud storage buckets get-iam-policy§11.8
gcloud storage buckets update--autoclass-terminal-storage-class, --default-encryption-key, --enable-autoclass, --lifecycle-file§11.9
gcloud storage objects update--content-type, --custom-metadata, --event-based-hold, --retain-until§11.3
gcloud storage sign-url--duration, --http-verb, --impersonate-service-account§11.11

F.10 SQL §

Cloud SQL instances, backups, and the connection controls. Two flags here are effectively permanent. CMEK is creation-time only, so --disk-encryption-key on create is a decision that cannot be revisited without rebuilding the instance (§12.14). Private IP is the same: an instance created without it needs a migration, not a patch. --connector-enforcement is the one control that changes the connection model outright — setting it to REQUIRED disables every existing authorized network in the same operation, so it belongs in a maintenance window rather than in a routine patch (§12.17).

CommandFlags that carry the decision§
gcloud sql backups create--instance§12.10
gcloud sql instances create--availability-type, --database-flags, --database-version, --deletion-protection§12.1
gcloud sql instances describe§12.5
gcloud sql instances failover§12.8
gcloud sql instances list§12.5
gcloud sql instances patch--backup-start-time, --database-flags, --enable-google-private-path, --enable-point-in-time-recovery§12.6
gcloud sql instances promote-replica§12.9
gcloud sql users create--instance, --type§12.7

F.11 Logging §

Sinks, buckets, views, and the read path. logging read is for investigation; a sink is what makes a log durable beyond its bucket's retention (§17.11).

CommandFlags that carry the decision§
gcloud logging buckets create--description, --enable-analytics, --location, --retention-days§17.7
gcloud logging buckets update--location, --locked§17.14
gcloud logging links create--bucket, --description, --location§17.18
gcloud logging metrics create--description, --log-filter§18.2
gcloud logging read--freshness, --order, --organization§17.1
gcloud logging settings update--kms-key-name§17.14
gcloud logging sinks create--description, --include-children, --log-filter, --organization§17.9
gcloud logging sinks describe--organization§17.9
gcloud logging views add-iam-policy-binding--bucket, --location, --member, --role§17.8
gcloud logging views create--bucket, --description, --location, --log-filter§17.8
gcloud pubsub topics add-iam-policy-binding--member, --role§17.16

F.12 Monitoring §

Alerting policies, notification channels, and uptime checks. Policies and channels are defined in files rather than in flags, which is the property that makes them reviewable in version control and diffable in a pull request (§18.15). That is also why this section is short: most of the configuration lives in the YAML or JSON the command consumes, not in the command line, and the section that owns each policy shows the document. The one alpha surface in the whole book appears here, and a GA equivalent exists at §18.19.

CommandFlags that carry the decision§
gcloud alpha monitoring policies list (Preview)§6.20
gcloud monitoring dashboards create--config-from-file§18.3
gcloud monitoring policies create--policy-from-file§18.4
gcloud monitoring policies describe§18.19
gcloud monitoring policies list§18.19
gcloud monitoring snoozes create--criteria-policies, --display-name, --end-time, --start-time§18.16
gcloud monitoring uptime create--path, --period, --port, --protocol§18.5
gcloud monitoring uptime list-configs§18.19

F.13 Security §

The security surface across services: organization policy, Security Command Center, KMS, Secret Manager, and Binary Authorization. Every write to an organization policy goes through set-policy and a file — there is no allow or deny subcommand (§31.1).

CommandFlags that carry the decision§
gcloud access-context-manager levels create--basic-level-spec, --combine-function, --policy, --title§4.15
gcloud access-context-manager perimeters create--perimeter-type, --policy, --resources, --restricted-services§20.2
gcloud access-context-manager perimeters dry-run create--perimeter-resources, --perimeter-restricted-services, --perimeter-title, --perimeter-type§20.8
gcloud assured workloads create--billing-account, --compliance-regime, --display-name, --help§30.5
gcloud beta terraform vet (Preview)--policy-library, --region, --zone§26.25
gcloud container binauthz attestations create--artifact-url, --attestor, --payload-file, --public-key-id§25.11
gcloud container binauthz policy import--strict-validation§25.10
gcloud kms inventory search-protected-resources--keyname, --scope§29.8
gcloud kms keyrings create--location§14.2
gcloud kms keys create--allowed-access-reasons, --default-algorithm, --keyring, --location§14.3
gcloud kms keys get-iam-policy--keyring, --location§14.13
gcloud kms keys set-rotation-schedule--keyring, --location, --next-rotation-time, --rotation-period§14.12
gcloud kms keys versions destroy--key, --keyring, --location§14.18
gcloud org-policies describe--effective, --organization§2.30
gcloud org-policies list--organization, --show-unset§31.1
gcloud org-policies set-custom-constraint§2.30
gcloud org-policies set-policy§2.30
gcloud scc findings list--field-mask, --organization, --source§16.3
gcloud scc iac-validation-reports create--tf-plan-file§22.12
gcloud scc manage services update--enablement-state, --organization§16.6
gcloud scc muteconfigs create--description, --organization, --type§16.3
gcloud secrets add-iam-policy-binding--member, --role§13.4
gcloud secrets create--labels, --locations, --replication-policy, --version-destroy-ttl§13.2
gcloud secrets versions add§13.3
gcloud secrets versions destroy--secret§13.3

Sources §

Every command and flag in this appendix was resolved against the installed Cloud SDK rather than from documentation, so the authority is the SDK itself: