Skip to content

TelemetryLink Terraform Creation State #1558

Description

@ozanichkovsky

Description

As confirmed by a note within the STACKIT portal, audit logs of a hierarchy object (org/folder/project) can only be sent to one single telemetry router. This is further reflected in the portal itself, which only allows the creation of one single telemetry link per hierarchy object.
Observed Behavior:
Despite this constraint, the Terraform provider behaves inconsistently in this regard:

  • In some cases, it is possible to create two telemetry links on the same hierarchy object without any immediate error being raised.
  • However, when subsequently attempting to modify or delete these resources, the provider throws strange and unclear error messages, making it difficult to remediate the situation.

Steps to reproduce

resource "stackit_telemetrylink" "link" {
  resource_type       = "project"
  resource_id         = "e0335458-e68b-4c19-b844-f39cd44a2dc6"
  region              = "eu01"
  display_name        = "telemetrylink-example"
  access_token        = "eyJxxx"
  telemetry_router_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

resource "stackit_telemetrylink" "link2" {
  resource_type       = "project"
  resource_id         = "e0335458-e68b-4c19-b844-f39cd44a2dc6"
  region              = "eu01"
  display_name        = "telemetrylink-example"
  description         = "telemetrylink description"
  access_token        = "eyJxxx"
  telemetry_router_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
  1. Run terraform ...
  2. See two states are created for the same resource hierarchy.

Actual behavior

Despite this constraint, the Terraform provider behaves inconsistently in this regard:
• In some cases, it is possible to create two telemetry links on the same hierarchy object without any immediate error being raised.
• However, when subsequently attempting to modify or delete these resources, the provider throws strange and unclear error messages, making it difficult to remediate the situation.

Expected behavior

The Terraform provider should enforce the one-telemetry-link-per-hierarchy-object constraint consistently and return a clear, descriptive error message at creation time if a telemetry link already exists for the given hierarchy object — rather than allowing an invalid state to be created silently.
Impact:
This behavior can lead to an inconsistent Terraform state, making infrastructure management unreliable and causing confusion during plan/apply/destroy operations.

Environment

  • OS:
  • Terraform version (see terraform --version): v1.15.7
  • Version of the STACKIT Terraform provider: v0.101.0

Additional information

Feel free to add any additional information here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions