Skip to content
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

snowflake_tag_association does not fully support objects #1496

Closed
yo0824 opened this issue Jan 27, 2023 · 6 comments
Closed

snowflake_tag_association does not fully support objects #1496

yo0824 opened this issue Jan 27, 2023 · 6 comments
Assignees
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:tag_association Issue connected to the snowflake_tag_association resource

Comments

@yo0824
Copy link

yo0824 commented Jan 27, 2023

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.

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 yo0824 added the bug Used to mark issues with provider's incorrect behavior label Jan 27, 2023
@PedroMartinSteenstrup
Copy link

same for External Tables

@JustinParathazham
Copy link

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

@sfc-gh-jcieslak sfc-gh-jcieslak added feature-request Used to mark issues with provider's missing functionalities and removed bug Used to mark issues with provider's incorrect behavior labels Mar 18, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

sfc-gh-jcieslak commented Mar 18, 2024

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 sfc-gh-jcieslak added category:resource resource:tag_association Issue connected to the snowflake_tag_association resource labels May 20, 2024
sfc-gh-jmichalak added a commit that referenced this issue Oct 21, 2024
<!-- Feel free to delete comments as you fill this in -->

<!-- summary of changes -->
- add missing object types
(#1496,
#1862,
#2598)
- adjust show options
- add ifExists to tag queries
- add missing masking policy note about v1 rc
- add integration tests for setting, getting, and unsetting tags,
except:
  - failover group - business critical edition needed
  - alert, password policy, network policy - missing tag handling in SDK
- git repo, iceberg table, budget, classification, replication group -
objects not implemented in the sdk

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested
-->
* [x] integration tests
<!-- add more below if you think they are relevant -->
* [x] unit tests

## References
<!-- issues documentation links, etc  -->
https://docs.snowflake.com/en/sql-reference/sql/create-tag
https://docs.snowflake.com/en/user-guide/object-tagging
https://docs.snowflake.com/en/sql-reference/functions/system_get_tag

## TODO
- change GetTag to not fail on null values
- move tag assignments integration tests to a common place
- restrict the list of object types we want to support, instead of all
of them
- rework tag, tag_association resource
- remove tag_masking_policy_association_resource (tag_association will
be used instead)
@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Oct 23, 2024
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @yo0824 , @PedroMartinSteenstrup, @JustinParathazham 👋

We've released a new v0.98.0 version (release, migration guide) with missing object types. Specifically, database roles, procedures and external tables should be now covered.

@sfc-gh-jmichalak
Copy link
Collaborator

Closing due to inactivity.

Also, we've just released v0.100.0 (release, migration guide) with more improvements in tag associations. Please upgrade to this version and let us know if you have any issues.

@PedroMartinSteenstrup
Copy link

works now indeed !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:tag_association Issue connected to the snowflake_tag_association resource
Projects
None yet
Development

No branches or pull requests

5 participants