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

[Docs]: snowflake_tag_association: Unclear how to reference a tag by its literal name #3357

Closed
1 task
lostkamp opened this issue Jan 23, 2025 · 3 comments
Closed
1 task
Assignees
Labels
docs Used to mark issues with documentation remark/questions general-usage General help/usage questions resource:tag_association Issue connected to the snowflake_tag_association resource

Comments

@lostkamp
Copy link

Company Name

Flix

Object type(s)

resource:tag_association

Documentation Link

https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/tag_association

Description

Hi,

I am trying to add a tag to a table like this:

resource "snowflake_tag_association" "table_tag" {
  object_identifier {
    name     = snowflake_table.id_assignment.name
    database = var.database
    schema   = var.schema
  }
  object_type = "TABLE"
  tag_id      = "\"MY_DB\".\"MY_SCHEMA\".\"some.tag\""
  tag_value   = "value"
}

However the apply step fails with Error: [errors.go:22] object does not exist or not authorized.

The docs only have examples of referencing tags by their terraform identifier. I am not sure if I overlooked something, but in any case I think it is worthwhile to add an example to the docs showing how to reference a tag that is not in terraform.

References

No response

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@lostkamp lostkamp added the docs Used to mark issues with documentation remark/questions label Jan 23, 2025
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @lostkamp 👋

You seem to be using the old resource before rework. It has been reworked in v0.100.0 (release, migration guide). Please upgrade to at least this version.

  1. The reference to your table should now look like object_identifiers = [snowflake_table.id_assignment.fully_qualified_name].
  2. Under the example section, we link to our identifiers guide. There we explain how to reference objects managed outside Terraform.
  3. If you still have some issues, please send logs with TF_LOG=DEBUG.

@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Jan 23, 2025
@sfc-gh-jmichalak sfc-gh-jmichalak added general-usage General help/usage questions and removed docs Used to mark issues with documentation remark/questions labels Jan 23, 2025
@lostkamp
Copy link
Author

Hi Jakub,

thanks, you were right, the update solved the problem.

But I still think it makes sense to add such an example to the docs.

@sfc-gh-jmichalak
Copy link
Collaborator

Closing, because the fix is confirmed.

We link to this identifiers guide in the examples of all the resources. Using fully_qualified_name is the preferred way because it's less error-prone, and that's why it's present in the examples. We understand that some objects are not managed in Terraform and should be referenced "manually," and that's why this guide exists.

@sfc-gh-asawicki sfc-gh-asawicki added docs Used to mark issues with documentation remark/questions resource:tag_association Issue connected to the snowflake_tag_association resource labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Used to mark issues with documentation remark/questions general-usage General help/usage questions resource:tag_association Issue connected to the snowflake_tag_association resource
Projects
None yet
Development

No branches or pull requests

3 participants