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

[Bug]: Event trigger overrides EJSON configuration

Open adamMo opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Provider Version

v1.22.0

Terraform Version

v1.7.5

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

My trigger configuration looks like this below. In Atlas console I have turned on the Enable Extended JSON option that does not exist in terraform provider. Any time I set up a new trigger or change anything in the existing one, my config is overwritten by terraform... What can I do to prevent that?

Terraform configuration to reproduce the issue

resource "mongodbatlas_event_trigger" "audit_trigger" {
	app_id                      = local.app_id[0]
	name                        = "audit_trigger"
	project_id                  = local.mongo_project_id
	type                        = "DATABASE"
	config_operation_types = ["INSERT", "UPDATE", "REPLACE", "DELETE"]
	config_database             = var.mongo_users_db
	config_collection           = "cases"
	config_service_id           = local.service_id[0]
	unordered                   = false
	config_full_document        = true
	config_full_document_before = true

	disabled = false

	event_processors {
		aws_eventbridge {
			config_account_id = data.aws_caller_identity.current.account_id
			config_region     = local.region
		}
	}
}

Steps To Reproduce

  1. Terraform apply this config

Logs

No response

Code of Conduct

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

adamMo avatar Dec 11 '24 16:12 adamMo

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-289410 was created for internal tracking.

github-actions[bot] avatar Dec 11 '24 16:12 github-actions[bot]

thanks @adamMo for opening the issue.

I've been able to reproduce the issue. It happens because the API Update operation is PUT so it will update all attributes, if not sent they'll be reset.

We've added this item to our backlog, we'll keep this issue open in the meantime

lantoli avatar Dec 16 '24 14:12 lantoli

@lantoli great, waiting for that feature then!

adamMo avatar Dec 19 '24 10:12 adamMo

hey @lantoli are there any plans to touch this topic?

adamMo avatar Jun 12 '25 12:06 adamMo

Hi @adamMo, thanks for reaching out to us. A the moment, adding support for the extended_json_enabled field in Terraform is not planned and there isn't a timeline for it.

On the other hand, our provider is open-source and we welcome and review external contributions.

Thank you for your understanding!

marcosuma avatar Jun 12 '25 16:06 marcosuma