<commit_before>---
layout: "linode"
page_title: "Linode: linode_nodebalancer_node"
sidebar_current: "docs-linode-resource-nodebalancer_node"
description: |-
  Manages a Linode NodeBalancer Node.
---

# linode\_nodebalancer\_node

Provides a Linode NodeBalancer Node resource.  This can be used to create, modify, and delete Linodes NodeBalancer Nodes.
For more information, see [Getting Started with NodeBalancers](https://www.linode.com/docs/platform/nodebalancer/getting-started-with-nodebalancers/) and the [Linode APIv4 docs](https://developers.linode.com/api/v4#operation/createNodeBalancerNode).

## Example Usage

The following example shows how one might use this resource to configure NodeBalancer Nodes attached to Linode instances.

```hcl
resource "linode_instance" "web" {
    count = "3"
    label = "web-${count.index + 1}"
    image = "linode/ubuntu18.04"
    region = "us-east"
    type = "g6-standard-1"
    authorized_keys = ["ssh-rsa AAAA...Gw== user@example.local"]
    root_pass = "<PASSWORD>"

    private_ip = true
}

resource "linode_nodebalancer" "foobar" {
    label = "mynodebalancer"
    region = "us-east"
    client_conn_throttle = 20
}

resource "linode_nodebalancer_config" "foofig" {
    nodebalancer_id = "${linode_nodebalancer.foobar.id}"
    port = 80
    protocol = "http"
    check = "http"
    check_path = "/foo"
    check_attempts = 3
    check_timeout = 30
    stickiness = "http_cookie"
    algorithm = "source"
}

resource "linode_nodebalancer_node" "foonode" {
    nodebalancer_id = "${linode_nodebalancer.foobar.id}"
    config_id = "${linode_nodebalancer_config.foofig.id}"
    address = "${linode_instance.web.*.private_ip_address}:80"
    label = "mynodebalancernode"
    weight = 50
}
```

## Argument Reference

The following arguments are supported:

* `nodebalancer_id` - (Required) The ID of the NodeBalancer to access.

* `config_id` - (Required) The ID of the NodeBalancerConfig to access.

* `address` - (Required) The private IP Address where this backend can be reached. This must be a private IP address.

- - -

* `label` - (Optional) The label of the Linode NodeBalancer Node. This is for display purposes only.

* `mode` - (Optional) The mode this NodeBalancer should use when sending traffic to this backend. If set to `accept` this backend is accepting traffic. If set to `reject` this backend will not receive traffic. If set to `drain` this backend will not receive new traffic, but connections already pinned to it will continue to be routed to it

* `weight` - (Optional) Used when picking a backend to serve a request and is not pinned to a single backend yet. Nodes with a higher weight will receive more traffic. (1-255).

## Attributes

This resource exports the following attributes:

* `status` - The current status of this node, based on the configured checks of its NodeBalancer Config. (unknown, UP, DOWN).

* `config_id` - The ID of the NodeBalancerConfig this NodeBalancerNode is attached to.

* `nodebalancer_id` - The ID of the NodeBalancer this NodeBalancerNode is attached to.

## Import

NodeBalancer Nodes can be imported using the NodeBalancer `nodebalancer_id` followed by the NodeBalancer Config `config_id` followed by the NodeBalancer Node `id`, separated by a comma, e.g.<commit_msg>Label argument is required for nodebalancer_node<commit_after>---
layout: "linode"
page_title: "Linode: linode_nodebalancer_node"
sidebar_current: "docs-linode-resource-nodebalancer_node"
description: |-
  Manages a Linode NodeBalancer Node.
---

# linode\_nodebalancer\_node

Provides a Linode NodeBalancer Node resource.  This can be used to create, modify, and delete Linodes NodeBalancer Nodes.
For more information, see [Getting Started with NodeBalancers](https://www.linode.com/docs/platform/nodebalancer/getting-started-with-nodebalancers/) and the [Linode APIv4 docs](https://developers.linode.com/api/v4#operation/createNodeBalancerNode).

## Example Usage

The following example shows how one might use this resource to configure NodeBalancer Nodes attached to Linode instances.

```hcl
resource "linode_instance" "web" {
    count = "3"
    label = "web-${count.index + 1}"
    image = "linode/ubuntu18.04"
    region = "us-east"
    type = "g6-standard-1"
    authorized_keys = ["ssh-rsa AAAA...Gw== <EMAIL>@<EMAIL>.local"]
    root_pass = "<PASSWORD>"

    private_ip = true
}

resource "linode_nodebalancer" "foobar" {
    label = "mynodebalancer"
    region = "us-east"
    client_conn_throttle = 20
}

resource "linode_nodebalancer_config" "foofig" {
    nodebalancer_id = "${linode_nodebalancer.foobar.id}"
    port = 80
    protocol = "http"
    check = "http"
    check_path = "/foo"
    check_attempts = 3
    check_timeout = 30
    stickiness = "http_cookie"
    algorithm = "source"
}

resource "linode_nodebalancer_node" "foonode" {
    nodebalancer_id = "${linode_nodebalancer.foobar.id}"
    config_id = "${linode_nodebalancer_config.foofig.id}"
    address = "${linode_instance.web.*.private_ip_address}:80"
    label = "mynodebalancernode"
    weight = 50
}
```

## Argument Reference

The following arguments are supported:

* `label` - (Required) The label of the Linode NodeBalancer Node. This is for display purposes only.

* `nodebalancer_id` - (Required) The ID of the NodeBalancer to access.

* `config_id` - (Required) The ID of the NodeBalancerConfig to access.

* `address` - (Required) The private IP Address where this backend can be reached. This must be a private IP address.

- - -

* `mode` - (Optional) The mode this NodeBalancer should use when sending traffic to this backend. If set to `accept` this backend is accepting traffic. If set to `reject` this backend will not receive traffic. If set to `drain` this backend will not receive new traffic, but connections already pinned to it will continue to be routed to it

* `weight` - (Optional) Used when picking a backend to serve a request and is not pinned to a single backend yet. Nodes with a higher weight will receive more traffic. (1-255).

## Attributes

This resource exports the following attributes:

* `status` - The current status of this node, based on the configured checks of its NodeBalancer Config. (unknown, UP, DOWN).

* `config_id` - The ID of the NodeBalancerConfig this NodeBalancerNode is attached to.

* `nodebalancer_id` - The ID of the NodeBalancer this NodeBalancerNode is attached to.

## Import

NodeBalancer Nodes can be imported using the NodeBalancer `nodebalancer_id` followed by the NodeBalancer Config `config_id` followed by the NodeBalancer Node `id`, separated by a comma, e.g.
{'fraction_non_alphanumeric': 0.09438543247344461, 'fraction_numerical': 0.007587253414264037, 'mean_word_length': 4.181603773584905, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4726947', 'n_tokens_mistral': 2067, 'n_tokens_neox': 1993, 'n_words': 710}