Skip to content

[Bug]: when creating a project with invalid tags, the project is created, but the provider returns an error #4124

@mbyio

Description

@mbyio

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

v2.5.0

Terraform Version

v1.12.2

Terraform Edition

Terraform Cloud

Current Behavior

We are new MongoDB Atlas customers.

When I go to create a project, the Terraform provider allows tags with invalid characters.

When I apply the Terraform code, the apply fails with a 400 error explaining that the tags are wrong. But the project is still created.

So now the next time I try to apply the Terraform, it will fail, because a project already exists with the same name.

Terraform configuration to reproduce the issue

resource "mongodbatlas_project" "main" {
  name = "my-project"
  org_id = "my-org"
  tags = {
    atag = "invalid.characters/com"
  }
}

Steps To Reproduce

  1. Make a plan to add tags with invalid characters
  2. Run terraform apply
  3. Apply will fail
  4. The project will be created anyway

Logs

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions