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

Add 'labels' in stackit_mongodbflex_instance

Open HDBK2297 opened this issue 3 months ago • 1 comments

Problem description

The current stackit_mongodbflex_instance Terraform resource does not provide any mechanism to set database labels on the created MongoDB instances. This prevents us from distinguishing between created instances for operational purposes. The underlying STACKIT MongoDB Flex API, however, appears to support this functionality, as indicated by the API documentation (payload -> labels): https://docs.api.eu01.stackit.cloud/documentation/mongodb-flex-service/version/v1#tag/instance/paths/~1v1~1projects~1%7BprojectId%7D~1instances/post

Proposed solution

We request the addition of an optional labels field to the stackit_mongodbflex_instance resource, allowing users to define arbitrary Key-Value pairs that are propagated to the underlying STACKIT resource for better instance organization.

resource "stackit_mongodbflex_instance" "example" {
  project_id  = "some.......id"
  # instance-specific configuration...
  
  # NEW FIELD REQUIRED
  labels = {
    "first" = "label"
    "second" = "label"
  }
}

HDBK2297 avatar Oct 22 '25 09:10 HDBK2297

Thank you @HDBK2297 for the request. We will take a look at it soon.

Benjosh95 avatar Oct 24 '25 06:10 Benjosh95