[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[[["\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)"]]