bigquery: add policyTags support to ignore_schema_changes on google_b… #16248
+609
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add support for
policyTagsas a value in theignore_schema_changesvirtual field ongoogle_bigquery_table. This mirrors the existingdataPoliciesimplementation (PR #23495, PR #25721) and allows users to ignore externally-applied policy tag changes without having to ignore the entire schema.Problem
BigQuery policy tags (
policyTags) are often managed outside Terraform by automated tools (e.g., PII auto-taggers that scan tables daily). Since theschemaattribute is a single JSON blob,ignore_changescannot target individual fields within it — users must either ignore the entire schema or manually track every tag change in their Terraform config.The
ignore_schema_changesfield already supportsdataPolicies(data masking policies). This PR extends it to also supportpolicyTags(column-level access control tags), which are a different schema field (TableFieldSchema.policyTagsvsTableFieldSchema.dataPolicies).Related Issues
Behavior
When
ignore_schema_changes = ["policyTags"]is set:Changes
resource_bigquery_table.go.tmpl: AddedmergePolicyTags()andmergePolicyTagsIntoMap()functions, updated diff suppression, CustomizeDiff, and Update logicresource_bigquery_table_internal_test.go.tmpl: Unit tests for diff suppress, merge struct, merge map, isChangeableresource_bigquery_table_test.go: 3-stage acceptance test (TestAccBigQueryTable_PolicyTagsMerge)bigquery_table.html.markdown: Updated docs to mentionpolicyTagsalongsidedataPolicies