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
Data Catalog - Add ability to link to existing entries (or obtain the entryId) via linkedResource #6766
Comments
For anyone who needs this functionality now for BQ resources - the For example, > echo -n "projects/my-project/datasets/my-dataset/tables/my-table" | base64
cHJvamVjdHMvbXktcHJvamVjdC9kYXRhc2V0cy9teS1kYXRhc2V0L3RhYmxlcy9teS10YWJsZQ== So that table in the US location results in the following entryId:
My current workaround to generate the entryId based on the above info is as follows: locals {
table_location = lower(google_bigquery_table.default.location)
base64_encoded_id = trim(base64encode(google_bigquery_table.default.id), "=")
datacatalog_entry_id = "projects/${google_bigquery_table.default.project}/locations/${local.table_location}/entryGroups/@bigquery/entries/${local.base64_encoded_id}"
} This is for a table but is basically the same for a dataset. |
That's great to know! Thanks for the info @tylerwengerd-cr |
@tylerwengerd-cr Any chance you know if this workaround also works for column-level resources? |
@burnzy unfortunately no, I never got into column-level resources when I was working with this. Here is the best relevant documentation I can find on resource names (that you've probably already read 😄 ) so it might take some poking around with the API to see if it's even supported. Good luck! |
Can anyone confirm this workaround still works? When trying to attach to an existing dataset/entry I'm seeing:
|
This is what I've done as a workaround (Requires gcloud cli installed):
The entry location can be retreived using |
…CR interface (hashicorp#6766) Co-authored-by: Luca Prete <lucaprete@google.com> Signed-off-by: Modular Magician <magic-modules@google.com>
Community Note
Description
When creating any BigQuery table or dataset on GCP, it is automatically assigned an entry, with a path of the form
Currently, the google_data_catalog_entry resource only allows for the creation of new entries, rather than linking to an existing entry. As such, any tags created are attached to the new entry, and not onto the existing entry/table.
As such, please add the ability to obtain the entryId relating to the existing BigQuery linkedResource (https://cloud.google.com/data-catalog/docs/reference/rest/v1/entries/lookup)
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: