digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
508 stars 277 forks source link

digitalocean_database_cluster: tagged twice #959

Open soullivaneuh opened 1 year ago

soullivaneuh commented 1 year ago

Bug Report


Describe the bug

Create the following digitalocean_database_cluster configuration:

variable "environment" {
  type = string
}

resource "digitalocean_vpc" "default" {
  name   = var.environment
  region = "ams3"
}

resource "digitalocean_database_cluster" "mongodb" {
  name       = "mongo"
  engine     = "mongodb"
  version    = "6.0"
  size       = "db-s-1vcpu-1gb"
  region     = "ams3"
  node_count = 1
  private_network_uuid = digitalocean_vpc.default.id
  tags = [
    var.environment,
  ]
}

Affected Resource(s)

Expected Behavior

The created database cluster should have a tag with the name of var.environment

Actual Behavior

The created database cluster should have a tag with the name of var.environment, but twice.

![image](https://user-images.githubusercontent.com/1698357/222257395-d2448735-1354-4325-b2f9-d973c803f694.png)

Steps to Reproduce

Terraform Configuration Files

Terraform version

terraform --version
Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/digitalocean/digitalocean v2.26.0

Debug Output

Panic Output

Additional context

Important Factoids

References

andrewsomething commented 1 year ago

Hi @soullivaneuh,

Thanks for raising this issue. I have been able to reproduce this both using the Terraform provider as well as with a simple cURL request. So the issue seems to be with the DigitalOcean DBaaS API itself rather than the provider. I've flagged this internally with the DBaaS team.