terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

snowflake_tag_association does not fully support objects

Open yo0824 opened this issue 2 years ago • 3 comments

Provider Version

0.55.1

Terraform Version

1.3.7

Describe the bug

The snowflake_tag_association resource supports insufficient object type, for example, when using the resource with the object_type as procecure, it fails.

Expected behavior

The resource should support all objects as described below.

  • https://docs.snowflake.com/en/user-guide/object-tagging.html#supported-objects

Code samples and commands

# PROCEDURE
resource "snowflake_tag_association" "tag_associations" {
    object_type   = "PROCEDURE"
    object_identifier {
      database    = "TEST_DB"
      schema      = "TEST_SCHEMA"
      name        = "TEST_PROCEDURE_NAME"
    }
    tag_id        = "TAG_DB.TAG_SCHEMA.TAG_NAME"
    tag_value     = "TEST"
}

Error:

expected object_type to be one of [ACCOUNT COLUMN DATABASE INTEGRATION PIPE ROLE SCHEMA STREAM SHARE STAGE TABLE TASK USER VIEW WAREHOUSE], got PROCEDURE

yo0824 avatar Jan 27 '23 07:01 yo0824

same for External Tables

PedroMartinSteenstrup avatar Feb 01 '24 13:02 PedroMartinSteenstrup

Also for Database Roles

│ Error: expected object_type to be one of ["ACCOUNT" "COLUMN" "DATABASE" "INTEGRATION" "PIPE" "ROLE" "SCHEMA" "STREAM" "SHARE" "STAGE" "TABLE" "TASK" "USER" "VIEW" "WAREHOUSE"], got DATABASE ROLE

JustinParathazham avatar Mar 18 '24 14:03 JustinParathazham

Hi 👋

We are currently working on redesigning existing resources as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#supporting-all-snowflake-ga-features. As this is simply updating validation slice to match what's on the Snowflake side, we'll do it when going over snowflake_tag_association. Unfortunately, I cannot give any approximate time when it will happen. Soon, we should provide an updated contribution guide, but as the change seems pretty simple (updating the list of valid object_types) you can try to create pr for it, so it will end up in the provider much faster.

sfc-gh-jcieslak avatar Mar 18 '24 14:03 sfc-gh-jcieslak