hardgcloud

Add network tags to a Compute Engine instance for firewall rule targeting

command

gcloud compute instances add-tags INSTANCE_NAME --tags TAG1,TAG2 --zone ZONE

also accepted

gcloud compute instances add-tagsgcloud compute instances add-tags INSTANCE_NAME --tags TAG1,TAG2

Command breakdown

Part of the Google Cloud CLI (gcloud) — Compute Engine category.

gcloudcomputeinstancesadd-tagsINSTANCE_NAME--tagsTAG1,TAG2--zoneZONE
FlagPurpose
--tagsBoolean flag
--zoneBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →