[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Access control with Google Cloud tags\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/sql/docs/postgres/tags \"View this page for the PostgreSQL database engine\") \\| [SQL Server](/sql/docs/sqlserver/tags \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\nThis page describes Google Cloud tags and how to use them with\nCloud SQL. To add tags to your Cloud SQL instances using\n`gcloud` now, see [Attach and manage tags on Cloud SQL instances](/sql/docs/mysql/manage-tags). To add tags to your Cloud SQL\ninstances using the Google Cloud console now, see [Create and manage tags on your instance](/resource-manager/docs/tags/tags-creating-and-managing).\n\nOverview\n--------\n\nGoogle Cloud *tags* are a way to organize your Cloud SQL resources.\n\nTags are applied at higher levels of the [resource hierarchy](/resource-manager/docs/cloud-platform-resource-hierarchy)\nacross Google Cloud. Cloud SQL and other instances inherit the tags.\nThey are managed using [Resource Manager](/resource-manager/docs/tags/tags-overview).\nYou can add a reference to tags in [IAM policy bindings](/iam/docs/tags-access-control)\nto grant conditional access to resources.\n\nTags are different from [labels](/resource-manager/docs/creating-managing-labels#what-are-labels),\nwhich are another way to organize and filter your instances. Tags and labels\nwork independently of each other, and you can use both on the same instance. For\nmore information about using labels in Cloud SQL, see\n[Label instances](/sql/docs/mysql/label-instance).\n\nWhat are tags?\n--------------\n\nTags are key-value pairs you can apply to your resources for fine-grained access\ncontrol.\n\nA tag key could be a property, such as `environment`, and the tag value could be\nan attribute, such as `development` or `production`. A tag can have only one\nvalue for a given key on a particular resource.\n\nTags are created at the Organization level. Tags are attached to resources, such\nas a project or a Cloud SQL instance, through the\n[Resource Manager](/resource-manager/docs/tags/tags-overview), which is used\nacross Google Cloud.\n\nGrant permissions based on conditional tag bindings\n---------------------------------------------------\n\nOnce a tag is attached to or inherited by a Cloud SQL instance,\nyou can [use the tag](/iam/docs/conditions-attribute-reference#resource-tags)\nwith IAM Conditions to grant access to Cloud SQL\nresources conditionally. IAM Conditions let you impose\nfine-grain access control to Cloud SQL instances. To use\nIAM Conditions, you reference the tags in IAM\npolicy bindings. For more information on how to use tags to grant conditional\naccess to Cloud SQL instances, see\n[Use IAM conditions](/sql/docs/mysql/iam-conditions).\n\nIf you add tag-based bindings to an instance, then you can grant access to Cloud SQL resources conditionally. Based on this conditional access, you\ncan see all backups of the active instance as well as the [final backups](/sql/docs/mysql/backup-recovery/backups#final-backups) of instances that are deleted\nand have the same name. However, after you delete an instance with tag bindings,\nyou can't see any backups related to the instance name. This is because you\ndeleted the instance and the tags can no longer be determined.\n\nRestrictions\n------------\n\nTags have the following restrictions:\n\n- [Organization policies](/resource-manager/docs/organization-policy/tags-organization-policy) can conditionally reference tags inherited from the Project level and above, but don't support tags that are directly attached to Cloud SQL instances.\n- [Cloud Audit logs](/storage/docs/audit-logging) show the creation and deletion of tags, but entries are not generated for attaching tags and viewing tag bindings on Cloud SQL instances.\n\nWhat's next\n-----------\n\n- Learn how to [create and manage tags on your instance](/resource-manager/docs/tags/tags-creating-and-managing) using Resource Manager.\n- See specific `gcloud` commands for Cloud SQL in [Manage tags on Cloud SQL](/sql/docs/mysql/manage-tags).\n- Learn about [IAM conditions](/sql/docs/mysql/iam-overview#iam-conditions).\n- Learn how to [use IAM conditions with Cloud SQL](/sql/docs/mysql/iam-conditions)."]]