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.36k stars 1.75k forks source link

Missing resource BigQuery DataTransfert projects.enrollDataSources #20217

Open jnahelou opened 2 weeks ago

jnahelou commented 2 weeks ago

Community Note

Description

When setting up a BigQuery data transfer job for carbon footprint data, there's an important prerequisite step that isn't mentioned in the official documentation, but can be discovered by examining the audit logs from Cloud Console operations.

Before creating the transfer job, you need to explicitly enable access to carbon footprint data by enrolling the following data source:

serviceName: "bigquerydatatransfer.googleapis.com"
methodName: "google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSources"
dataSourceIds: [
    "61cede5a-0000-2440-ad42-883d24f8f7b8"
]

If this prerequisite enrollment step is not completed, you will encounter the following error:

Error: Error creating Config: googleapi: Error 400: BigQuery DataTransfer is not enabled for 61cede5a-0000-2440-ad42-883d24f8f7b8.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_bigquery_data_transfer_enroll_data_sources" "carbon" {
  project = "x"
  data_source_ids = ["61cede5a-0000-2440-ad42-883d24f8f7b8"]
}

References

b/378508253

SarahFrench commented 1 week ago

Note from triage: We have analogous resources that set project-level settings (e.g. google_project_service ) so this fits into preexisting norms in the provider

wj-chen commented 6 days ago

This could be a new bigquerydatatransfer resource. The BQ Terraform team doesn't have capacity to take in new feature requests in Q4 at this time but we'll bring it into planning for Q1.