INTEGRATION_FIELDS_INVALID error from Atlas API when trying to enable Datadog integration

Hi,

I’m trying to enable Datadog third party integration in one of my MongoDB Atlas projects. My projects are managed using Terraform, therefore it is relying on the MongoDB Atlas API. When I’m performing Terraform apply it fails with below API error.

Error:

Error: error creating third party integration POST https://cloud.mongodb.com/api/atlas/v1.0/groups/<GROUP_ID>/integrations/DATADOG: 400 (request “INTEGRATION_FIELDS_INVALID”) At least one integration field is invalid.

Relevant code block:

resource "mongodbatlas_project" "project" {
  name   = var.project_name
  org_id = var.org_id

  dynamic "teams" {
    for_each = var.teams

    content {
      team_id    = mongodbatlas_teams.team[teams.key].team_id
      role_names = [teams.value.role]
    }
  }

  is_performance_advisor_enabled = var.is_performance_advisor_enabled
}

resource "mongodbatlas_third_party_integration" "datadog_integration" {
  count = var.enable_datadog_integration ? 1 : 0

  project_id = mongodbatlas_project.project.id
  type       = "DATADOG"
  api_key    = var.datadog_api_key
  region     = var.datadog_region
}

# in tfvar file
enable_datadog_integration  = true
datadog_region              = "US"

Additionally the Datadog API key value is set as an environment variable and it contains the correct value.

I’d appreciate any leads on the error code INTEGRATION_FIELDS_INVALID or on anything that I’ve mistaken in here.

Refs:
Terraform module doc: Terraform Registry
Atlas doc: https://www.mongodb.com/docs/atlas/tutorial/third-party-service-integrations/

PS. Atlas doc specifies US1, US3, US5, and EU1 as the values for Datadog regions and specifying them resulted in below error:

Error: error creating third party integration POST https://cloud.mongodb.com/api/atlas/v1.0/groups/<GROUP_ID>/integrations/DATADOG: 400 (request "INVALID_ENUM_VALUE") An invalid enumeration value US1 was specified.

Hi, The Terraform documentation indicates that there are two valid options - EU or US.


https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/third_party_integration

Hi Tonya, I initially tried US as mentioned in the Terraform documentation and it resulted in a similar error with an error message saying “Invalid value not included in the enumeration” or something similar to that.