Delete an NLB
STACKIT Network Load Balancers (NLBs) can be deleted via the STACKIT Portal, STACKIT API, or the STACKIT Terraform provider.
Preparation
Section titled “Preparation”Before you delete an NLB, consider the following to avoid unintended outages:
- Traffic impact: Deleting an NLB immediately stops traffic forwarding. Plan cutover and update DNS, clients, or firewall rules accordingly.
- IP addresses: If the NLB used a separately managed Public IP, decide whether to detach and reuse it or delete it. Private addresses are ephemeral.
- Security groups and rules: If you referenced the NLB’s security group in other rules, clean those up after deletion.
- Observability credentials: Any observability credentials you created specifically for this NLB can be removed independently if no longer needed.
Process
Section titled “Process”Follow the steps below to delete an NLB using your preferred method:
Navigate to portal.stackit.cloud, select your desired project and follow these steps:
- In the sidebar under Networking, click on Network Load Balancer.
- Locate the NLB you want to delete and open its details or use the actions menu.
- Click Delete and confirm the deletion in the dialog.
Once confirmed, the NLB and its underlying nodes and security groups will be removed shortly.
Prerequisites
Section titled “Prerequisites”To delete a STACKIT Network Load Balancer via API, you need a temporary Bearer token for authentication under a Service Account.
- Read Access services with a service account to learn how to create a Service Account and generate a Bearer token.
- Read the STACKIT CLI Authentication Guide to learn more about CLI and environment setups that enable you to acquire Bearer tokens.
- Refer to the STACKIT Network Load Balancer API documentation for endpoint details.
Request details
Section titled “Request details”Method: DELETE
Endpoint URL:
https://load-balancer.api.stackit.cloud/v2/projects/{projectId}/regions/{region}/load-balancers/{name}Headers:
Authorization: Bearer <your_bearer_token>
Example using cURL:
curl -X DELETE \ "https://load-balancer.api.stackit.cloud/v2/projects/$PROJECT_ID/regions/$REGION/load-balancers/$LB_NAME" \ -H "Authorization: Bearer $TOKEN"On success, the API returns 200 OK with an empty body. The NLB will be deleted shortly after the request is accepted.
If you manage your infrastructure declaratively with Terraform using the official STACKIT Terraform provider, delete the NLB by removing the resource from code or destroying it directly.
Minimal resource definition for context:
resource "stackit_loadbalancer" "example" { project_id = "your-project-uuid" name = "example-load-balancer"
networks = [ { network_id = "your-network-uuid" role = "ROLE_LISTENERS_AND_TARGETS" } ] options = { private_network_only = true }
target_pools = [ { name = "example-pool" target_port = 80 targets = [ { display_name = "target-1" ip = "10.0.0.1" } ] } ]
listeners = [ { display_name = "example-listener" port = 80 protocol = "PROTOCOL_TCP" target_pool = "example-pool" } ]}You can delete the NLB in two common ways:
- Remove the
stackit_loadbalancerresource from your Terraform code and runterraform applyto reconcile state. - Run a targeted destroy:
terraform destroy -target=stackit_loadbalancer.example.
If you created a separate stackit_public_ip or other related resources, decide whether to keep or destroy them as part of cleanup.