Get started with Pulumi in a free one hour introductory workshop. Register Now

NodeBalancerNode

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 and the Linode APIv4 docs.

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.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

class MyStack : Stack
{
    public MyStack()
    {
        var web = new List<Linode.Instance>();
        for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            web.Add(new Linode.Instance($"web-{range.Value}", new Linode.InstanceArgs
            {
                AuthorizedKeys = 
                {
                    "ssh-rsa AAAA...Gw== user@example.local",
                },
                Image = "linode/ubuntu18.04",
                Label = $"web-{range.Value + 1}",
                PrivateIp = true,
                Region = "us-east",
                RootPass = "test",
                Type = "g6-standard-1",
            }));
        }
        var foobar = new Linode.NodeBalancer("foobar", new Linode.NodeBalancerArgs
        {
            ClientConnThrottle = 20,
            Label = "mynodebalancer",
            Region = "us-east",
        });
        var foofig = new Linode.NodeBalancerConfig("foofig", new Linode.NodeBalancerConfigArgs
        {
            Algorithm = "source",
            Check = "http",
            CheckAttempts = 3,
            CheckPath = "/foo",
            CheckTimeout = 30,
            NodebalancerId = foobar.Id,
            Port = 80,
            Protocol = "http",
            Stickiness = "http_cookie",
        });
        var foonode = new List<Linode.NodeBalancerNode>();
        for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            foonode.Add(new Linode.NodeBalancerNode($"foonode-{range.Value}", new Linode.NodeBalancerNodeArgs
            {
                Address = web.Select(__item => __item.PrivateIpAddress).ToList()[range.Value].Apply(privateIpAddresses => $"{privateIpAddresses}:80"),
                ConfigId = foofig.Id,
                Label = "mynodebalancernode",
                NodebalancerId = foobar.Id,
                Weight = 50,
            }));
        }
    }

}

Coming soon!

import pulumi
import pulumi_linode as linode

web = []
for range in [{"value": i} for i in range(0, 3)]:
    web.append(linode.Instance(f"web-{range['value']}",
        authorized_keys=["ssh-rsa AAAA...Gw== user@example.local"],
        image="linode/ubuntu18.04",
        label=f"web-{range['value'] + 1}",
        private_ip=True,
        region="us-east",
        root_pass="test",
        type="g6-standard-1"))
foobar = linode.NodeBalancer("foobar",
    client_conn_throttle=20,
    label="mynodebalancer",
    region="us-east")
foofig = linode.NodeBalancerConfig("foofig",
    algorithm="source",
    check="http",
    check_attempts=3,
    check_path="/foo",
    check_timeout=30,
    nodebalancer_id=foobar.id,
    port=80,
    protocol="http",
    stickiness="http_cookie")
foonode = []
for range in [{"value": i} for i in range(0, 3)]:
    foonode.append(linode.NodeBalancerNode(f"foonode-{range['value']}",
        address=[__item.private_ip_address for __item in web][range["value"]].apply(lambda private_ip_addresses: f"{private_ip_addresses}:80"),
        config_id=foofig.id,
        label="mynodebalancernode",
        nodebalancer_id=foobar.id,
        weight=50))
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const web: linode.Instance[] = [];
for (let i = 0; i < 3; i++) {
    web.push(new linode.Instance(`web-${i}`, {
        authorizedKeys: ["ssh-rsa AAAA...Gw== user@example.local"],
        image: "linode/ubuntu18.04",
        label: `web-${(i + 1)}`,
        privateIp: true,
        region: "us-east",
        rootPass: "test",
        type: "g6-standard-1",
    }));
}
const foobar = new linode.NodeBalancer("foobar", {
    clientConnThrottle: 20,
    label: "mynodebalancer",
    region: "us-east",
});
const foofig = new linode.NodeBalancerConfig("foofig", {
    algorithm: "source",
    check: "http",
    checkAttempts: 3,
    checkPath: "/foo",
    checkTimeout: 30,
    nodebalancerId: foobar.id.apply(id => Number.parseFloat(id)),
    port: 80,
    protocol: "http",
    stickiness: "http_cookie",
});
const foonode: linode.NodeBalancerNode[] = [];
for (let i = 0; i < 3; i++) {
    foonode.push(new linode.NodeBalancerNode(`foonode-${i}`, {
        address: pulumi.all(web.map(v => v.privateIpAddress)).apply(privateIpAddress => `${privateIpAddress.map(v => v)[i]}:80`),
        configId: foofig.id.apply(id => Number.parseFloat(id)),
        label: "mynodebalancernode",
        nodebalancerId: foobar.id.apply(id => Number.parseFloat(id)),
        weight: 50,
    }));
}

Create a NodeBalancerNode Resource

def NodeBalancerNode(resource_name: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, config_id: Optional[int] = None, label: Optional[str] = None, mode: Optional[str] = None, nodebalancer_id: Optional[int] = None, weight: Optional[int] = None)
name string
The unique name of the resource.
args NodeBalancerNodeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NodeBalancerNodeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NodeBalancerNodeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NodeBalancerNode Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The NodeBalancerNode resource accepts the following input properties:

Address string

The private IP Address where this backend can be reached. This must be a private IP address.

ConfigId int

The ID of the NodeBalancerConfig to access.

Label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

NodebalancerId int

The ID of the NodeBalancer to access.

Mode string

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 int

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).

Address string

The private IP Address where this backend can be reached. This must be a private IP address.

ConfigId int

The ID of the NodeBalancerConfig to access.

Label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

NodebalancerId int

The ID of the NodeBalancer to access.

Mode string

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 int

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).

address string

The private IP Address where this backend can be reached. This must be a private IP address.

configId number

The ID of the NodeBalancerConfig to access.

label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

nodebalancerId number

The ID of the NodeBalancer to access.

mode string

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 number

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).

address str

The private IP Address where this backend can be reached. This must be a private IP address.

config_id int

The ID of the NodeBalancerConfig to access.

label str

The label of the Linode NodeBalancer Node. This is for display purposes only.

nodebalancer_id int

The ID of the NodeBalancer to access.

mode str

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 int

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).

Outputs

All input properties are implicitly available as output properties. Additionally, the NodeBalancerNode resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Status string

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

Id string
The provider-assigned unique ID for this managed resource.
Status string

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

id string
The provider-assigned unique ID for this managed resource.
status string

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

id str
The provider-assigned unique ID for this managed resource.
status str

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

Look up an Existing NodeBalancerNode Resource

Get an existing NodeBalancerNode resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: NodeBalancerNodeState, opts?: CustomResourceOptions): NodeBalancerNode
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, config_id: Optional[int] = None, label: Optional[str] = None, mode: Optional[str] = None, nodebalancer_id: Optional[int] = None, status: Optional[str] = None, weight: Optional[int] = None) -> NodeBalancerNode
func GetNodeBalancerNode(ctx *Context, name string, id IDInput, state *NodeBalancerNodeState, opts ...ResourceOption) (*NodeBalancerNode, error)
public static NodeBalancerNode Get(string name, Input<string> id, NodeBalancerNodeState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Address string

The private IP Address where this backend can be reached. This must be a private IP address.

ConfigId int

The ID of the NodeBalancerConfig to access.

Label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

Mode string

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

NodebalancerId int

The ID of the NodeBalancer to access.

Status string

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

Weight int

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).

Address string

The private IP Address where this backend can be reached. This must be a private IP address.

ConfigId int

The ID of the NodeBalancerConfig to access.

Label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

Mode string

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

NodebalancerId int

The ID of the NodeBalancer to access.

Status string

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

Weight int

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).

address string

The private IP Address where this backend can be reached. This must be a private IP address.

configId number

The ID of the NodeBalancerConfig to access.

label string

The label of the Linode NodeBalancer Node. This is for display purposes only.

mode string

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

nodebalancerId number

The ID of the NodeBalancer to access.

status string

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

weight number

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).

address str

The private IP Address where this backend can be reached. This must be a private IP address.

config_id int

The ID of the NodeBalancerConfig to access.

label str

The label of the Linode NodeBalancer Node. This is for display purposes only.

mode str

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

nodebalancer_id int

The ID of the NodeBalancer to access.

status str

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

weight int

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).

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.

 $ pulumi import linode:index/nodeBalancerNode:NodeBalancerNode https-foobar-1 1234567,7654321,9999999

The Linode Guide, Import Existing Infrastructure to Terraform, offers resource importing examples for NodeBalancer Nodes and other Linode resource types.

Package Details

Repository
https://github.com/pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.