DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
403 stars 376 forks source link

Updating datadog_logs_archive with new GCP integration #2072

Open GauthierMenier opened 1 year ago

GauthierMenier commented 1 year ago

Datadog Terraform Provider Version

v3.28.0

Terraform Version

v1.5.3

What resources or data sources are affected?

datadog_logs_archive

Terraform Configuration Files

No response

Relevant debug or panic output

During a Terraform deployment with the new GCP integration in Datadog (a service account instead of a project ID), the update no longer seems to work.

Expected Behavior

Modification complete.

Actual Behavior

Error: error updating logs archive from https://api.datadoghq.eu/api/v2/logs/config/archives/: 400 Bad Request: {"errors":["The specified GCP project id and client email have not been configured."]}

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

nkzou commented 1 year ago

Could you reach out to Datadog support at https://help.datadoghq.com/? We don't have much context on integration issues, and a support engineer would be able to see exactly why your requests are 400ing.

GauthierMenier commented 1 year ago

I created a support ticket to Datadog.

enmuro commented 1 year ago

same issue here after migrating to new GCP integration

tested on provider versions:

pravindahal commented 10 months ago

We have the same issue with version 3.34.0. Did you hear back from Datadog @GauthierMenier.

msenmurugan commented 10 months ago

Had a similar issue. Worked with the DD support team. It seems some logs need to flow first before setting up the DD log archive. However, this was not the case with the older DD provider version.

pravindahal commented 9 months ago

We uptated to using the datadog_integration_gcp_sts module and then after the integration was in-place in Datadog, we had to manually change to the new integration in the Datadog UI. After that, it started working in subsequent runs.

Suryadeb7781 commented 7 months ago

This seems to be a bug. Please comment out "project_id" and it works. See the below code snippet for reference. update: It only works on Mac and Linux. Windows provider for TF has a bug and I could not find any fix for windows.

resource "datadog_logs_archive" "datadog_gcs_archive" { name = "${var.datadog_archive_name}-gcs-archive" query = "*" gcs_archive { bucket = client_email =

project_id = var.project_id

} }

msenmurugan commented 7 months ago

The below setting worked for me

resource "datadog_logs_archive" "dd_logs_archive" {
  name  = "${var.datadog_archive_name}-datadog-logs"
  query = "*"
  gcs_archive {
    bucket       = var.bucket_name
    path         = "/"
    client_email = google_service_account.datadog_integration.email
    project_id   = var.project_id
  }
  include_tags = true
}