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.32k stars 1.72k forks source link

gcloud alpha trace sinks #15590

Open ensonic opened 1 year ago

ensonic commented 1 year ago

Community Note

Description

In order to use trace ingestion on a GCP project one needs to fall back to gcloud commands, e.g.

gcloud alpha trace sinks create spans bigquery.googleapis.com/projects/${data.google_project.project.number}/datasets/traces --project ${var.project}
gcloud alpha trace sinks describe spans --project=${var.project} --format='value(writer_identity)' | xargs -I {} gcloud projects add-iam-policy-binding ${var.project} --member serviceAccount:{} --role roles/bigquery.dataEditor --condition=None

New or Affected Resource(s)

https://cloud.google.com/trace/docs/trace-export-configure

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

References

melinath commented 1 year ago

It looks like this resource is available in a beta API: https://cloud.google.com/trace/docs/reference/v2/rest/v2beta1/projects.traceSinks

SarahFrench commented 11 months ago

Adding some more info as I'm adding this ticket to a list of issues for people onboarding to the Google provider:

Managing this resource uses the https://cloudtrace.googleapis.com API (see docs), so adding support for this new resource is probably going to start with adding a cloudtrace folder in the mmv1/products folder. This section of the contribution guide explains what the folders in mmv1/products contains and the YAML files that need to be created when adding a new product to the Google provider.

michaelgmiller1 commented 1 day ago

Any updates on this? We are using trace sinks and would find this very useful.