Reference documentation and code samples for the Data Loss Prevention V2 Client class TagResources.
If set, attaches the tags
provided to profiled resources. Tags support access
control. You can
conditionally grant or deny access to a resource based on whether the
resource has a specific tag.
Generated from protobuf message google.privacy.dlp.v2.DataProfileAction.TagResources
The profile generations for which the tag should be attached to resources. If you attach a tag to only new profiles, then if the sensitivity score of a profile subsequently changes, its tag doesn't change. By default, this field includes only new profiles. To include both new and updated profiles for tagging, this field should explicitly include both PROFILE_GENERATION_NEW and PROFILE_GENERATION_UPDATE.
↳ lower_data_risk_to_low
bool
Whether applying a tag to a resource should lower the risk of the profile for that resource. For example, in conjunction with an IAM deny policy, you can deny all principals a permission if a tag value is present, mitigating the risk of the resource. This also lowers the data risk of resources at the lower levels of the resource hierarchy. For example, reducing the data risk of a table data profile also reduces the data risk of the constituent column data profiles.
The profile generations for which the tag should be attached to
resources. If you attach a tag to only new profiles, then if the
sensitivity score of a profile subsequently changes, its tag doesn't
change. By default, this field includes only new profiles. To include
both new and updated profiles for tagging, this field should explicitly
include both PROFILE_GENERATION_NEW and PROFILE_GENERATION_UPDATE.
The profile generations for which the tag should be attached to
resources. If you attach a tag to only new profiles, then if the
sensitivity score of a profile subsequently changes, its tag doesn't
change. By default, this field includes only new profiles. To include
both new and updated profiles for tagging, this field should explicitly
include both PROFILE_GENERATION_NEW and PROFILE_GENERATION_UPDATE.
Parameter
Name
Description
var
int[]
Returns
Type
Description
$this
getLowerDataRiskToLow
Whether applying a tag to a resource should lower the risk of the profile
for that resource. For example, in conjunction with an IAM deny
policy, you can deny
all principals a permission if a tag value is present, mitigating the
risk of the resource. This also lowers the data risk of resources at the
lower levels of the resource hierarchy. For example, reducing the data
risk of a table data profile also reduces the data risk of the
constituent column data profiles.
Returns
Type
Description
bool
setLowerDataRiskToLow
Whether applying a tag to a resource should lower the risk of the profile
for that resource. For example, in conjunction with an IAM deny
policy, you can deny
all principals a permission if a tag value is present, mitigating the
risk of the resource. This also lowers the data risk of resources at the
lower levels of the resource hierarchy. For example, reducing the data
risk of a table data profile also reduces the data risk of the
constituent column data profiles.
[[["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-09 UTC."],[],[],null,["# Data Loss Prevention V2 Client - Class TagResources (2.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.1 (latest)](/php/docs/reference/cloud-dlp/latest/V2.DataProfileAction.TagResources)\n- [2.6.0](/php/docs/reference/cloud-dlp/2.6.0/V2.DataProfileAction.TagResources)\n- [2.4.1](/php/docs/reference/cloud-dlp/2.4.1/V2.DataProfileAction.TagResources)\n- [2.3.0](/php/docs/reference/cloud-dlp/2.3.0/V2.DataProfileAction.TagResources)\n- [2.2.3](/php/docs/reference/cloud-dlp/2.2.3/V2.DataProfileAction.TagResources)\n- [2.1.0](/php/docs/reference/cloud-dlp/2.1.0/V2.DataProfileAction.TagResources)\n- [2.0.0](/php/docs/reference/cloud-dlp/2.0.0/V2.DataProfileAction.TagResources)\n- [1.19.0](/php/docs/reference/cloud-dlp/1.19.0/V2.DataProfileAction.TagResources)\n- [1.18.0](/php/docs/reference/cloud-dlp/1.18.0/V2.DataProfileAction.TagResources)\n- [1.17.0](/php/docs/reference/cloud-dlp/1.17.0/V2.DataProfileAction.TagResources)\n- [1.16.0](/php/docs/reference/cloud-dlp/1.16.0/V2.DataProfileAction.TagResources)\n- [1.15.1](/php/docs/reference/cloud-dlp/1.15.1/V2.DataProfileAction.TagResources)\n- [1.14.0](/php/docs/reference/cloud-dlp/1.14.0/V2.DataProfileAction.TagResources)\n- [1.13.2](/php/docs/reference/cloud-dlp/1.13.2/V2.DataProfileAction.TagResources)\n- [1.12.0](/php/docs/reference/cloud-dlp/1.12.0/V2.DataProfileAction.TagResources)\n- [1.11.0](/php/docs/reference/cloud-dlp/1.11.0/V2.DataProfileAction.TagResources)\n- [1.10.2](/php/docs/reference/cloud-dlp/1.10.2/V2.DataProfileAction.TagResources)\n- [1.9.0](/php/docs/reference/cloud-dlp/1.9.0/V2.DataProfileAction.TagResources)\n- [1.8.6](/php/docs/reference/cloud-dlp/1.8.6/V2.DataProfileAction.TagResources) \nReference documentation and code samples for the Data Loss Prevention V2 Client class TagResources.\n\nIf set, attaches the [tags](https://cloud.google.com/resource-manager/docs/tags/tags-overview)\nprovided to profiled resources. Tags support [access\ncontrol](https://cloud.google.com/iam/docs/tags-access-control). You can\nconditionally grant or deny access to a resource based on whether the\nresource has a specific tag.\n\nGenerated from protobuf message `google.privacy.dlp.v2.DataProfileAction.TagResources`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dlp \\\\ V2 \\\\ DataProfileAction\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getTagConditions\n\nThe tags to associate with different conditions.\n\n### setTagConditions\n\nThe tags to associate with different conditions.\n\n### getProfileGenerationsToTag\n\nThe profile generations for which the tag should be attached to\nresources. If you attach a tag to only new profiles, then if the\nsensitivity score of a profile subsequently changes, its tag doesn't\nchange. By default, this field includes only new profiles. To include\nboth new and updated profiles for tagging, this field should explicitly\ninclude both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`.\n\n### setProfileGenerationsToTag\n\nThe profile generations for which the tag should be attached to\nresources. If you attach a tag to only new profiles, then if the\nsensitivity score of a profile subsequently changes, its tag doesn't\nchange. By default, this field includes only new profiles. To include\nboth new and updated profiles for tagging, this field should explicitly\ninclude both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`.\n\n### getLowerDataRiskToLow\n\nWhether applying a tag to a resource should lower the risk of the profile\nfor that resource. For example, in conjunction with an [IAM deny\npolicy](https://cloud.google.com/iam/docs/deny-overview), you can deny\nall principals a permission if a tag value is present, mitigating the\nrisk of the resource. This also lowers the data risk of resources at the\nlower levels of the resource hierarchy. For example, reducing the data\nrisk of a table data profile also reduces the data risk of the\nconstituent column data profiles.\n\n### setLowerDataRiskToLow\n\nWhether applying a tag to a resource should lower the risk of the profile\nfor that resource. For example, in conjunction with an [IAM deny\npolicy](https://cloud.google.com/iam/docs/deny-overview), you can deny\nall principals a permission if a tag value is present, mitigating the\nrisk of the resource. This also lowers the data risk of resources at the\nlower levels of the resource hierarchy. For example, reducing the data\nrisk of a table data profile also reduces the data risk of the\nconstituent column data profiles."]]