[[["容易理解","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 (世界標準時間)。"],[[["\u003cp\u003eTags are key-value pairs used to organize and control access to Datastream resources like private connectivity configurations, connection profiles, and streams.\u003c/p\u003e\n"],["\u003cp\u003eUnlike labels, which are used for organization and filtering, tags enable fine-grained access control through IAM policy bindings and are managed via Resource Manager at the Organization level.\u003c/p\u003e\n"],["\u003cp\u003eDatastream resources can inherit tags from higher levels of the resource hierarchy, allowing for consistent access control across Google Cloud.\u003c/p\u003e\n"],["\u003cp\u003eAfter a tag is attached to a Datastream resource, IAM Conditions can reference it to conditionally grant permissions to the resource, giving the user fine-grain control.\u003c/p\u003e\n"],["\u003cp\u003eOrganization policies can use tags inherited from the Project level and above, but not those directly attached to Datastream resources, and while Cloud Audit Logs track tag creation and deletion, they don't record tag attachment or viewing.\u003c/p\u003e\n"]]],[],null,["# Access control with tags\n\nThis page describes tags and how to use them with\nDatastream. To use `gcloud` to attach, detach, and list tags on your Datastream resources, see [Manage tags](/datastream/docs/manage-tags).\n\nTags are a way to organize your Datastream resources. These resources include private connectivity configurations, connection profiles, and streams.\n\nTags are applied at higher levels of the [resource hierarchy](/resource-manager/docs/cloud-platform-resource-hierarchy)\nacross Google Cloud. Datastream and other resources 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 resources in Datastream. Tags and labels\nwork independently of each other, and you can use both on the same resource. You can learn about using labels with Datastream resources, including [connection profiles](/datastream/docs/create-connection-profiles) and [streams](/datastream/docs/create-a-stream).\n\nWhat are tags?\n--------------\n\nTags are key-value pairs you can apply to your Datastream 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 Datastream private connectivity configuration, connection profile, or stream, 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\nAfter a tag is attached to or inherited by a Datastream resource,\nyou can [use the tag](/iam/docs/conditions-attribute-reference#resource-tags)\nwith IAM Conditions to grant access to Datastream\nresources conditionally. IAM Conditions let you impose\nfine-grain access control to Datastream resources. To use\nIAM Conditions, you reference the tag in IAM\npolicy bindings.\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 higher, but don't support tags that are directly attached to Datastream resources.\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 Datastream resources.\n\nWhat's next\n-----------\n\n- Learn how to use Resource Manager to [create and manage tags for your Datastream resources](/resource-manager/docs/tags/tags-creating-and-managing).\n- See specific `gcloud` commands to attach, detach, and list tags on your Datastream resources in [Manage tags](/datastream/docs/manage-tags)."]]