Resource
dcloud_lb_target
A backend of a load balancer: an instance (type = "server") or an address (type = "ip").
Example Usage
resource "dcloud_lb_target" "web" {
for_each = toset([dcloud_instance.web_a.id, dcloud_instance.web_b.id])
load_balancer_id = dcloud_lb.web.id
type = "server"
instance_id = each.value
use_private_ip = true
}Schema
Required
load_balancer_id(String) The id of the parent resource ({id}in the path). Changing it replaces the resource.type(String)serverfor a Deutsche Cloud instance,ipfor an address One of:server,ip. Changing it replaces the resource.
Optional
instance_id(String) Instance id (i-…). Required when type is server (400 without). The instance must be in your organization (400 "Instance not found") and in the load balancer’s region (400). application and public dedicated: it needs a public IPv4 (400); private dedicated: it must be in the load balancer’s VPC and have an address there (400). Must match^i-[0-9a-f]{6,32}$. Changing it replaces the resource.ip(String) IPv4 address. Required when type is ip (400 without). application and public dedicated: a public address that is not the platform’s own (400); private dedicated: inside the VPC’s CIDR (400) Changing it replaces the resource.target_group(String) application load balancers: the target group this target serves (lower-case letters, digits and -, 1–32). Rules forward to a group; requests no rule matches go todefault. Defaultdefault; any other value is refused (400) on the other types. At most 10 groups and 25 targets per application load balancer (400). Must match^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$. Changing it replaces the resource.use_private_ip(Boolean) lb11/lb21/lb31, server targets: reach the instance over its private network address. Needs a load balancer created with vpcId (400). Refused (400) on application; ignored on dedicated, where the scheme decides (private: VPC address, public: public address). Default false Changing it replaces the resource.
Read-Only
id(String) The resource's id.status(String) What the last health check said.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import 'dcloud_lb_target.web["<instance-id>"]' <load-balancer-id>/<target-id>Generated from the provider's schema.
Related