Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to attach, detach, and list tags on AlloyDB for PostgreSQL
resources. For an overview of tags on AlloyDB, see
Organize AlloyDB resources using tags.
Tags that are attached to AlloyDB cluster resources are
inherited by child resources like instances. You can't override tags of those
child resources. For more information, see Tag inheritance.
Before you begin
To get the permissions that
you need to view and set tags on AlloyDB resources,
ask your administrator to grant you the
following IAM roles on your project:
Cloud AlloyDB Admin (roles/alloydb.admin):
assign to set and view tags
Cloud AlloyDB Viewer (roles/alloydb.viewer):
assign to view tags
After you've created and defined
a tag using Resource Manager, you can start using tags with AlloyDB
cluster and backup resources. For more information about the Google Cloud CLI
commands to use tag bindings, see
gcloud resource-manager tags bindings.
For all of the commands on this page, replace the following:
PARENT_PATH: The complete path to the backup or cluster resource—for example, //alloydb.googleapis.com/projects/my-project/locations/us-central1/backups/my-backup.
TAG_VALUE: The tag value that you want to attach to your resource—for example, the tag value set as 815471563813/environment/development includes the following components:
815471563813 is the organization ID or your project ID.
environment is the tag key.
development is the tag value.
LOCATION: The region where your cluster or backup is placed—for example, us-central1.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide details the process of managing tags on AlloyDB resources, including attaching, detaching, and listing tags.\u003c/p\u003e\n"],["\u003cp\u003eTo interact with tags on AlloyDB resources, users need to be granted either the Cloud AlloyDB Admin role for setting and viewing tags or the Cloud AlloyDB Viewer role for just viewing tags.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e command-line tool is used to manage tags on AlloyDB resources, requiring the parent resource path, tag value, and resource location as parameters.\u003c/p\u003e\n"],["\u003cp\u003eTags are managed using the \u003ccode\u003egcloud resource-manager tags bindings\u003c/code\u003e command, with subcommands \u003ccode\u003ecreate\u003c/code\u003e, \u003ccode\u003edelete\u003c/code\u003e, and \u003ccode\u003elist\u003c/code\u003e for attaching, detaching, and listing tags respectively.\u003c/p\u003e\n"],["\u003cp\u003eTag value components are a combination of the organization ID or project ID, the tag key and the tag value itself.\u003c/p\u003e\n"]]],[],null,["# Attach and manage tags on AlloyDB resources\n\nThis page describes how to attach, detach, and list tags on AlloyDB for PostgreSQL\nresources. For an overview of tags on AlloyDB, see\n[Organize AlloyDB resources using tags](/alloydb/docs/tags).\n\nTags that are attached to AlloyDB cluster resources are\ninherited by child resources like instances. You can't override tags of those\nchild resources. For more information, see [Tag inheritance](/resource-manager/docs/tags/tags-overview#inheritance).\n| **Note:** You can attach and manage labels on AlloyDB clusters using the AlloyDB API. You can't use the Google Cloud console or the Google Cloud CLI.\n\nBefore you begin\n----------------\n\n\nTo get the permissions that\nyou need to view and set tags on AlloyDB resources,\n\nask your administrator to grant you the\nfollowing IAM roles on your project:\n\n- Cloud AlloyDB Admin (`roles/alloydb.admin`): assign to set and view tags\n- Cloud AlloyDB Viewer (`roles/alloydb.viewer`): assign to view tags\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nWork with tags\n--------------\n\nAfter you've [created and defined](/resource-manager/docs/tags/tags-creating-and-managing#creating)\na tag using Resource Manager, you can start using tags with AlloyDB\ncluster and backup resources. For more information about the Google Cloud CLI\ncommands to use tag bindings, see\n[gcloud resource-manager tags bindings](/sdk/gcloud/reference/resource-manager/tags/bindings).\n\nFor all of the commands on this page, replace the following:\n\n- \u003cvar translate=\"no\"\u003ePARENT_PATH\u003c/var\u003e: The complete path to the backup or cluster resource---for example, `//alloydb.googleapis.com/projects/my-project/locations/us-central1/backups/my-backup`.\n- \u003cvar translate=\"no\"\u003eTAG_VALUE\u003c/var\u003e: The tag value that you want to attach to your resource---for example, the tag value set as `815471563813/environment/development` includes the following components:\n\n - `815471563813` is the organization ID or your project ID.\n\n - `environment` is the tag key.\n\n - `development` is the tag value.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region where your cluster or backup is placed---for example, `us-central1`.\n\n### Attach tags to AlloyDB resources\n\n```\ngcloud resource-manager tags bindings create \\\n--parent=PARENT_PATH \\\n--tag-value=TAG_VALUE \\\n--location=LOCATION\n```\n\n### Detach tags from AlloyDB resources\n\n```\ngcloud resource-manager tags bindings delete \\\n--parent=PARENT_PATH \\\n--tag-value=TAG_VALUE \\\n--location=LOCATION\n```\n\n### List tags on AlloyDB resources\n\n```\ngcloud resource-manager tags bindings list \\\n--parent=PARENT_PATH \\\n--location=LOCATION\n```\n\nWhat's next\n-----------\n\n- [Learn more about attaching tags to resources](/resource-manager/docs/tags/tags-creating-and-managing#attaching).\n- [Export Cloud Billing data to BigQuery with resource-level tags](/alloydb/docs/tags#billing-bq-export)"]]