terraform-provider-mongodbatlas icon indicating copy to clipboard operation
terraform-provider-mongodbatlas copied to clipboard

[Bug]: Federated Data Instances does not handle `dataProcessRegion`

Open sebastianhaeni opened this issue 3 months ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Provider Version

registry.terraform.io/mongodb/mongodbatlas v1.15.1

Terraform Version

Terraform v1.7.4 on darwin_amd64

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

When setting dataProcessRegion on mongodbatlas_federated_database_instance, this error appears:

│ Error: error updating MongoDB Atlas Federated Database Instace (engineering): https://cloud.mongodb.com/api/atlas/v2/groups/xxx/dataFederation/xxx PATCH: HTTP 400 Bad Request (Error code: "INVALID_JSON_ATTRIBUTE") Detail: Received JSON for the dataProcessRegion attribute does not match expected format. Reason: Bad Request. Params: [dataProcessRegion]

Probably relates to https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1634

Terraform configuration to reproduce the issue

resource "mongodbatlas_federated_database_instance" "federated-data-analytics" {
  project_id = "1234"
  name       = "test"
  data_process_region {
    cloud_provider = "AWS"
    region         = "EU_WEST_1"
  }
}

Steps To Reproduce

Either apply the Terraform resource.

Or set the dataProcessRegion on Atlas and then try to update that resource.

Logs

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

sebastianhaeni avatar Mar 12 '24 16:03 sebastianhaeni

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

  • Terraform configuration file used to reproduce the issue
  • Terraform log files from the run where the issue occurred
  • Terraform Atlas provider version used to reproduce the issue
  • Terraform version used to reproduce the issue
  • Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment

The ticket CLOUDP-237334 was created for internal tracking.

github-actions[bot] avatar Mar 12 '24 16:03 github-actions[bot]

Hello @sebastianhaeni!

I was able to reproduce your issue and identified that it is due to an incorrect value in data_process_region.region. By using the following adjusted configuration I was able to obtain a successful creation:

resource "mongodbatlas_federated_database_instance" "federated-data-analytics" {
  project_id = var.project_id
  name       = "test-oregon"
  data_process_region {
    cloud_provider = "AWS"
    region         = "OREGON_USA"
  }
}

As mentioned in our docs https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/federated_database_instance#region you can look into the supported values for the region attribute.

We will keep this ticket open so we can address gaps in our existing documentation and examples for the data_process_region attribute. Additional we will look into improving the error message so that it is more clear that the error is due to an incorrect value in the region.

AgustinBettati avatar Mar 15 '24 09:03 AgustinBettati

That was indeed the problem. I checked the value the API returns on the Atlas Web UI and it was EU_WEST_1. I guess that was unrelated.

sebastianhaeni avatar Mar 15 '24 10:03 sebastianhaeni

This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

github-actions[bot] avatar Mar 21 '24 00:03 github-actions[bot]

hi @sebastianhaeni , the PR has already been merged, and the fix will be available in the next release

lantoli avatar May 03 '24 07:05 lantoli