Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to a user, that user is claiming responsibility for the issue.
- Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
Terraform Version & Provider Version(s)
Terraform v1.11.3
on amd64
- provider registry.terraform.io/hashicorp/google v6.28.0
- provider registry.terraform.io/hashicorp/google-beta v6.28.0
Affected Resource(s)
google_bigquery_analytics_hub_listing_subscription
Terraform Configuration
Unfortunately the issue is still present in version 6.28.0
.
I've created the three resources (exchange, listing and dataset) to set up the subscription in project A by following the official documentation:
resource "google_bigquery_analytics_hub_data_exchange" "subscription" {
project = "project-a"
location = "US"
data_exchange_id = "my_data_exchange"
display_name = "my_data_exchange"
description = ""
}
resource "google_bigquery_dataset" "subscription" {
project = "project-a"
dataset_id = "my_dataset"
friendly_name = "my_dataset"
description = ""
location = "US"
}
resource "google_bigquery_analytics_hub_listing" "subscription" {
project = "project-a"
location = "US"
data_exchange_id = google_bigquery_analytics_hub_data_exchange.subscription.data_exchange_id
listing_id = "my_listing"
display_name = "my_listing"
description = ""
bigquery_dataset {
dataset = google_bigquery_dataset.subscription.id
}
}
Then I've tried to create the subscription in project B, as follows:
resource "google_bigquery_analytics_hub_listing_subscription" "subscription" {
location = "US"
data_exchange_id = google_bigquery_analytics_hub_data_exchange.subscription.data_exchange_id
listing_id = google_bigquery_analytics_hub_listing.subscription.listing_id
destination_dataset {
description = "A test subscription"
friendly_name = "👋"
labels = {
testing = "123"
}
location = "US"
dataset_reference {
dataset_id = "destination_dataset"
project_id = google_bigquery_dataset.subscription.project
}
}
}
As a result, I get this error when running terraform apply
:
google_bigquery_analytics_hub_listing_subscription.subscription: Creating...
╷
│ Error: Error creating ListingSubscription: googleapi: Error 404: Failed to find data exchange in projects/1099313479020: dataExchanges/my_data_exchange
│
│ with google_bigquery_analytics_hub_listing_subscription.subscription,
│ on main.tf line 30, in resource "google_bigquery_analytics_hub_listing_subscription" "subscription":
│ 30: resource "google_bigquery_analytics_hub_listing_subscription" "subscription" {
│
╵
If I repeat the same process but this time creating the subscription under project A, everything works as expected.
I've also tried to replace the references to google_bigquery_analytics_hub_data_exchange.subscription.data_exchange_id
and google_bigquery_analytics_hub_listing.subscription.listing_id
with the full resource id projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}
and projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}}
, respectively, but that also returns an error:
google_bigquery_analytics_hub_listing_subscription.subscription: Creating...
╷
│ Error: Error creating ListingSubscription: googleapi: got HTTP response code 404 with body:
│
│ with google_bigquery_analytics_hub_listing_subscription.subscription,
│ on main.tf line 30, in resource "google_bigquery_analytics_hub_listing_subscription" "subscription":
│ 30: resource "google_bigquery_analytics_hub_listing_subscription" "subscription" {
│
╵
Debug Output
No response
Expected Behavior
The subscription is successfully created under project B when the exchange, listing and dataset belong to project A.
Actual Behavior
Creating the subscription fails.
Steps to reproduce
Use the Terraform configuration above pointing to your testing GCP projects with required permissions and run terraform apply
.
Important Factoids
No response
References
b/420674656