-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: snowflake_tag_association failed to associate tag to schema #3235
Comments
Hi @harukitake 👋 Please use uppercase type |
Hi @sfc-gh-jmichalak . |
Could you provide provider logs with |
Log
2024-11-28T18:28:41.389+0900 [DEBUG] provider.terraform-provider-snowflake_v0.99.0: 2024/11/28 18:28:41 [DEBUG] sql-conn-query: [query SELECT CURRENT_ACCOUNT() as CURRENT_ACCOUNT err <nil> duration 70.869541ms args {}] ()
2024-11-28T18:28:41.445+0900 [DEBUG] provider.terraform-provider-snowflake_v0.99.0: 2024/11/28 18:28:41 [DEBUG] sql-conn-query: [query SELECT CURRENT_SESSION() as CURRENT_SESSION err <nil> duration 56.130792ms args {}] (MV33919)
2024-11-28T18:28:41.445+0900 [DEBUG] provider.terraform-provider-snowflake_v0.99.0: 2024/11/28 18:28:41 [DEBUG] connection success!
2024-11-28T18:28:41.445+0900 [DEBUG] ReferenceTransformer: "snowflake_tag_association.schema_fivetran_log" references: []
2024-11-28T18:28:41.446+0900 [DEBUG] ReferenceTransformer: "snowflake_tag_association.schema_github_zucks" references: []
snowflake_tag_association.schema_fivetran_log: Refreshing state... [id=VISION_MINDSTONE|TAG|OWNER]
snowflake_tag_association.schema_github_zucks: Refreshing state... [id=VISION_MINDSTONE|TAG|OWNER]
2024-11-28T18:28:41.448+0900 [ERROR] provider.terraform-provider-snowflake_v0.99.0: Response contains error diagnostic: @module=sdk.proto diagnostic_severity=ERROR diagnostic_summary="tagging for object type schema is not supported" diagnostic_detail="" tf_proto_version=6.4 tf_provider_addr=registry.terraform.io/Snowflake-Labs/snowflake tf_req_id=269e8f43-33e7-e8e0-69fa-8678030c3e37 @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov6/internal/diag/diagnostics.go:58 tf_resource_type=snowflake_tag_association tf_rpc=ReadResource timestamp="2024-11-28T18:28:41.448+0900"
2024-11-28T18:28:41.448+0900 [ERROR] provider.terraform-provider-snowflake_v0.99.0: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov6/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_severity=ERROR diagnostic_summary="tagging for object type schema is not supported" diagnostic_detail="" tf_proto_version=6.4 tf_provider_addr=registry.terraform.io/Snowflake-Labs/snowflake tf_req_id=1df529a7-9d67-4d25-2817-a40aa3db1de7 tf_resource_type=snowflake_tag_association tf_rpc=ReadResource timestamp="2024-11-28T18:28:41.448+0900"
2024-11-28T18:28:41.448+0900 [ERROR] vertex "snowflake_tag_association.schema_fivetran_log" error: tagging for object type schema is not supported
2024-11-28T18:28:41.448+0900 [ERROR] vertex "snowflake_tag_association.schema_github_zucks" error: tagging for object type schema is not supported
2024-11-28T18:28:41.448+0900 [ERROR] vertex "snowflake_tag_association.schema_fivetran_log (expand)" error: tagging for object type schema is not supported
2024-11-28T18:28:41.448+0900 [ERROR] vertex "snowflake_tag_association.schema_github_zucks (expand)" error: tagging for object type schema is not supported
2024-11-28T18:28:41.448+0900 [WARN] Planning encountered errors, so plan is not applyable
2024-11-28T18:28:41.448+0900 [INFO] backend/local: plan operation completed
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Warning: Argument is deprecated
│
│ with provider["registry.terraform.io/snowflake-labs/snowflake"],
│ on provider.tf line 17, in provider "snowflake":
│ 17: provider "snowflake" {
│
│ Use `account_name` and `organization_name` instead of `account`
╵
╷
│ Error: tagging for object type schema is not supported
│
│ with snowflake_tag_association.schema_fivetran_log,
│ on schema_tagging.tf line 2, in resource "snowflake_tag_association" "schema_fivetran_log":
│ 2: resource "snowflake_tag_association" "schema_fivetran_log" {
│
╵
╷
│ Error: tagging for object type schema is not supported
│
│ with snowflake_tag_association.schema_github_zucks,
│ on schema_tagging.tf line 13, in resource "snowflake_tag_association" "schema_github_zucks":
│ 13: resource "snowflake_tag_association" "schema_github_zucks" {
│
╵ |
I can't reproduce the issue for |
@sfc-gh-jmichalak {
"version": 4,
"terraform_version": "1.7.5",
"serial": 3,
"lineage": "65303413-352e-8c89-d724-e86bb1ffc396",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "terraform_remote_state",
"name": "vision_mindstone",
"provider": "provider[\"terraform.io/builtin/terraform\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"backend": "s3",
"config": {
"value": {
"bucket": "bucket",
"key": "/terraform.tfstate"
},
"type": [
"object",
{
"bucket": "string",
"key": "string"
}
]
},
"defaults": null,
"outputs": {
"value": {
"cost_tag_id": "VISION_MINDSTONE|TAG|OWNER"
},
"type": [
"object",
{
"cost_tag_id": "string"
}
]
},
"workspace": null
},
"sensitive_attributes": []
}
]
},
{
"mode": "managed",
"type": "snowflake_tag_association",
"name": "schema_fivetran_log",
"provider": "provider[\"registry.terraform.io/snowflake-labs/snowflake\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "VISION_MINDSTONE|TAG|OWNER",
"object_identifier": [
{
"database": "RAW",
"name": "FIVETRAN_LOG",
"schema": ""
}
],
"object_name": null,
"object_type": "schema",
"skip_validation": true,
"tag_id": "VISION_MINDSTONE|TAG|OWNER",
"tag_value": "aaaaa",
"timeouts": null
},
"sensitive_attributes": [],
"dependencies": [
"data.terraform_remote_state.vision_mindstone"
]
}
]
},
{
"mode": "managed",
"type": "snowflake_tag_association",
"name": "schema_github_zucks",
"provider": "provider[\"registry.terraform.io/snowflake-labs/snowflake\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "VISION_MINDSTONE|TAG|OWNER",
"object_identifier": [
{
"database": "RAW",
"name": "GITHUB_ZUCKS",
"schema": ""
}
],
"object_name": null,
"object_type": "schema",
"skip_validation": true,
"tag_id": "VISION_MINDSTONE|TAG|OWNER",
"tag_value": "@g_vision_developers",
"timeouts": null
},
"sensitive_attributes": [],
"dependencies": [
"data.terraform_remote_state.vision_mindstone"
]
}
]
}
],
"check_results": null
} |
I will try the following step.
|
# snowflake_tag_association.schema_zucks_vision_sandbox_snowpipe must be replaced
-/+ resource "snowflake_tag_association" "schema_zucks_vision_sandbox_snowpipe" {
~ id = "VISION_MINDSTONE|TAG|OWNER" -> (known after apply)
~ object_type = "schema" -> "SCHEMA" # forces replacement
# (3 unchanged attributes hidden)
# (1 unchanged block hidden)
} I fixed |
<!-- Feel free to delete comments as you fill this in --> - rework `tag_association` resource - return `nil` from GetTag instead of failing - add more tests regarding tag/masking policy: assert that `ALTER MASKING POLICY SET TAG` differs from `ALTER TAG SET MASKING POLICY` - support tagging account for identifiers with org name - support `IF EXISTS` for unsetting tags - add notes about manually unassigning policies from objects, add a todo with an issue number - fix a wrong issue number in essential objects list <!-- summary of changes --> ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests <!-- add more below if you think they are relevant --> * [ ] … ## References <!-- issues documentation links, etc --> https://docs.snowflake.com/en/user-guide/object-tagging https://docs.snowflake.com/en/sql-reference/functions/system_get_tag #3145 #1910 #2943 #3235 ## TODO - use generated config and asserts, remove old test `tf` files ## Ideas - extract a separate resource for tagging accounts?
Hi @harukitake 👋 We've just released v0.100.0 (release, migration guide) in which we support lowercase object types. Please upgrade to this version and let us know if you have any issues. |
@sfc-gh-jmichalak |
Great! Closing then. |
Terraform CLI Version
1.9.5
Terraform Provider Version
0.99.0
Company Name
No response
Terraform Configuration
Category
category:resource
Object type(s)
No response
Expected Behavior
successful plan and apply
Actual Behavior
Error: tagging for object type schema is not supported
Steps to Reproduce
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: