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 Resource Should Support all Object Types #1862

Closed
Willybaker1988 opened this issue Jun 7, 2023 · 2 comments
Closed

Snowflake Tag Resource Should Support all Object Types #1862

Willybaker1988 opened this issue Jun 7, 2023 · 2 comments
Assignees
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:tag Issue connected to the snowflake_tag resource

Comments

@Willybaker1988
Copy link

Is your feature request related to a problem? Please describe.

The existing resource available snowflake_tag only supports assigning a tag to a database and schema, this is a limitation as not all tags should be assigned to these Snowflake objects.

Describe the solution you'd like

There is a similar feature improvement mentioned here about default tags which would be useful #951.

The Snowflake documentation allows tags to be assigned directly to other Snowflake objects listed here https://docs.snowflake.com/en/user-guide/object-tagging#supported-objects.

The additional resource snowflake_tag_association is also limited by the scope of the snowflake_tag being associated to a database and schema first.

An example in psuedo

##table
resource "snowflake_tag" "tag" {
 name           = "cost_center"
  object_identifier {
    name     = snowflake_table.test.name
    database = snowflake_database.test.name 
    schema   = snowflake_schema.test.name
  }
  object_type = "TABLE"
  tag_value   = "engineering"
}
##role
resource "snowflake_tag" "tag" {
 name           = "cost_center"
  object_identifier {
    name     = snowflake_role.test.name
    database = null 
    schema   = null
  }
  object_type = "ROLE"
  tag_value   = "engineering"
}
@Willybaker1988 Willybaker1988 added the feature-request Used to mark issues with provider's missing functionalities label Jun 7, 2023
@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:tag Issue connected to the snowflake_tag 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 @Willybaker1988 👋

We've released a new v0.98.0 version (release, migration guide) with missing object types.

@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.

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 Issue connected to the snowflake_tag resource
Projects
None yet
Development

No branches or pull requests

3 participants