hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.25k stars 1.7k forks source link

Add google_bigquery_analytics_hub_subscription resource #15144

Open tanjt107 opened 1 year ago

tanjt107 commented 1 year ago

Community Note

Description

I would like to request the addition of the google_bigquery_analytics_hub_subscription resource to the Terraform provider for Google Cloud Platform. This resource would allow users to create and manage subscriptions to data exchanges and listings in Analytics Hub.

Currently, the only way to create a subscription to a data exchange or listing in Terraform is to use console or API. However, this is a workaround, and it is not ideal. The google_bigquery_analytics_hub_subscription would have all of the features that are needed for creating and managing subscriptions, and it would be consistent with the other resources in the Terraform provider for Google Cloud Platform.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_bigquery_analytics_hub_subscription" "default" {
  project-id = "my-project-id"
  location = "my-location"
  dataexchange0id = "my-dataexchange-id"
  listing-id = "my-listing-id"
}

References

b/291746281

DrFaust92 commented 12 months ago

Ill take a look as ive added support for hub and data exchange

DrFaust92 commented 12 months ago

Actually having a deeper look. not sure this fits terraform, there is no real CRUD here. only: https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1beta1/projects.locations.dataExchanges.listings/subscribe

There is no unsubscribe or get/list so there isnt a way to manage a state

louisRDSC commented 10 months ago

Hello @DrFaust92, it seems to have been added during august. is it what you were looking for? https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions

DrFaust92 commented 10 months ago

Yes, that might work. I'm going on vacation so I won't be looking at this for at least a few weeks. I will add though that I hope it will work as it will need to call different endpoints and not the same func as other resources (I'm assuming it will just not might be trivial)

terekete commented 9 months ago

@DrFaust92 - given the new methods on the API can this be done ?

Cidan commented 7 months ago

Hi there,

I'm part of the BigQuery team directly, and I have a draft PR open for this here as well. I expect to be done in the next few days and send the PR in for full review after that.

Let me know if you'd like to merge efforts here, or if you want to continue on your own PR @sachinpro

Thanks!