mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
242 stars 168 forks source link

Unable to create third party integration of type Datadog with version 1.8.0 #1038

Closed gregoirefra closed 1 year ago

gregoirefra commented 1 year ago

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v1.2.6
on darwin_amd64
+ provider registry.terraform.io/mongodb/mongodbatlas v1.8.0

Terraform Configuration File

resource "mongodbatlas_project" "project" {
  name                         = var.project
  org_id                       = var.atlas_org_id
  with_default_alerts_settings = false
}

resource "mongodbatlas_third_party_integration" "datadog" {
  project_id = mongodbatlas_project.project.id
  type       = "DATADOG"
  api_key    = var.datadog_api_key
  region     = "US"
}

Steps to Reproduce

  1. terraform plan
  2. terraform apply

Expected Behavior

No warning and integration gets configured on new project

Actual Behavior

Project gets created and integration configured from validating in the UI but the terraform integration resource mentions a failure of adding the integration because it's already configured.

╷
│ Error: error creating third party integration POST https://cloud.mongodb.com/api/atlas/v1.0/groups/xxxxxxxxxxx/integrations/DATADOG: 409 (request "INTEGRATION_ALREADY_CONFIGURED") The integration of type 'DATADOG' is already configured for this group.
│ 
│   with mongodbatlas_third_party_integration.datadog,
│   on main.tf line 7, in resource "mongodbatlas_third_party_integration" "datadog":
│   7: resource "mongodbatlas_third_party_integration" "datadog" {
│ 
╵

Additional Context

This seems to only apply on new integration but not existing resource

References

Most likely related to https://github.com/mongodb/terraform-provider-mongodbatlas/issues/1032 but wasn't sure so I created a second issue for it.

martinstibbe commented 1 year ago

@gregoirefra I started with v1.8.0 of provider it created project and Datadog integration and second apply did not attempt to build it again Only message I get is #1032 related(see below). Can you destroy project and capture logs with setting TF_LOG=TRACE ?

Warning: Argument is deprecated
│ 
│   with mongodbatlas_third_party_integration.datadog,
│   on main.tf line 428, in resource "mongodbatlas_third_party_integration" "datadog":
│  428:   type       = "DATADOG"
│ 
│ This field type has values (NEW_RELIC, FLOWDOCK) that are deprecated and will be removed in 1.9.0 release 
│ 
│ (and one more similar warning elsewhere)
gregoirefra commented 1 year ago

I'll close the issue since I can't seem to reproduce the issue anymore. Thanks for checking