A secure, isolated virtual network for connecting and managing your Vultr resources with private communication.
Configuring Network Settings for your Vultr Load Balancer involves associating it with a specific Virtual Private Cloud (VPC) network. This allows the Load Balancer to operate within the specified network, ensuring it interacts correctly with other resources and adheres to network policies.
Follow this guide to configure network settings for your Vultr Load Balancer using the Vultr Customer Portal, API, CLI, or Terraform.
Non‑Public VPC can be selected at creation time and, for Global Load Balancers, per region after creation.
Send a GET
request to the List Load Balancers endpoint to find your Load Balancer ID.
curl "https://api.vultr.com/v2/load-balancers" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Identify the target Load Balancer and VPC ID from the response.
Send a PATCH
request to the Update Load Balancer endpoint to assign a VPC network.
curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"vpc": "vpc-id-goes-here"
}'
List all available Load Balancers and note the ID of your target Load Balancer.
vultr-cli load-balancer list
Update the Load Balancer to assign it to a VPC.
vultr-cli load-balancer update <load-balancer-id> --vpc <vpc-id>
Open your Terraform configuration file for the existing Load Balancer and VPC.
Add the vpc_id
field to associate the Load Balancer with your target VPC.
resource "vultr_vpc" "private_net" {
region = "ewr"
description = "private-network"
}
resource "vultr_load_balancer" "lb" {
region = "ewr"
label = "vultr-load-balancer"
balancing_algorithm = "roundrobin"
vpc = vultr_vpc.private_net.id
}
Apply the configuration and observe the following output:
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
No comments yet.