Skip to content

Error deleting network area due to attached project not being deleted immediately #907

@flobeier

Description

@flobeier

Description

When Terraform tries to delete a network area immediately after deleting its attached project, an error will occur:

│ Error: Error deleting network area
│ 
│ You still have projects attached to the network area. Please delete or remove them from the network area before deleting the network area.
│ 

Apparently the project destruction is not immediate even though the STACKIT provider got the response that it was successful.

Steps to reproduce

resource "stackit_network_area" "test" {
  organization_id = "<redacted>"
  name            = "test-network-area"
  network_ranges = [
    {
      prefix = "10.1.0.0/16"
    }
  ]
  # Each project attached to this network area uses 1 IP address within the transfer network,
  # so choose the size accordingly (extension is not possible).
  transfer_network      = "10.255.255.0/24"
  default_nameservers   = ["9.9.9.9"]
  default_prefix_length = 24
  min_prefix_length     = 23
  max_prefix_length     = 26
}

resource "stackit_resourcemanager_project" "site_to_site_test" {
  parent_container_id = stackit_network_area.test.organization_id
  name                = "site-to-site-test"
  labels = {
    "networkArea" = stackit_network_area.test.network_area_id
  }
  owner_email = "email@example.com
}
  1. Run terraform destroy
  2. Error will occur
  3. Run terraform destroy again
  4. Command should be successful

Actual behavior

STACKIT project destruction takes a few seconds to take effect.

Expected behavior

Project really is deleted once reported as deleted to the STACKIT Terraform provider.

Environment

  • OS: Ubuntu 25.04
  • Terraform version (see terraform --version): v1.12.1
  • Version of the STACKIT Terraform provider: v0.56.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions