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
            {
                Label = $"web-{range.Value + 1}",
                Image = "linode/ubuntu18.04",
                Region = "us-east",
                Type = "g6-standard-1",
                AuthorizedKeys = 
                {
                    "ssh-rsa AAAA...Gw== user@example.local",
                },
                RootPass = "test",
                PrivateIp = true,
            }));
        }
        var foobar = new Linode.NodeBalancer("foobar", new Linode.NodeBalancerArgs
        {
            Label = "mynodebalancer",
            Region = "us-east",
            ClientConnThrottle = 20,
        });
        var foofig = new Linode.NodeBalancerConfig("foofig", new Linode.NodeBalancerConfigArgs
        {
            NodebalancerId = foobar.Id,
            Port = 80,
            Protocol = "http",
            Check = "http",
            CheckPath = "/foo",
            CheckAttempts = 3,
            CheckTimeout = 30,
            Stickiness = "http_cookie",
            Algorithm = "source",
        });
        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
            {
                NodebalancerId = foobar.Id,
                ConfigId = foofig.Id,
                Address = web.Select(__item => __item.PrivateIpAddress).ToList()[range.Value].Apply(privateIpAddresses => $"{privateIpAddresses}:80"),
                Label = "mynodebalancernode",
                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']}",
        label=f"web-{range['value'] + 1}",
        image="linode/ubuntu18.04",
        region="us-east",
        type="g6-standard-1",
        authorized_keys=["ssh-rsa AAAA...Gw== user@example.local"],
        root_pass="test",
        private_ip=True))
foobar = linode.NodeBalancer("foobar",
    label="mynodebalancer",
    region="us-east",
    client_conn_throttle=20)
foofig = linode.NodeBalancerConfig("foofig",
    nodebalancer_id=foobar.id,
    port=80,
    protocol="http",
    check="http",
    check_path="/foo",
    check_attempts=3,
    check_timeout=30,
    stickiness="http_cookie",
    algorithm="source")
foonode = []
for range in [{"value": i} for i in range(0, 3)]:
    foonode.append(linode.NodeBalancerNode(f"foonode-{range['value']}",
        nodebalancer_id=foobar.id,
        config_id=foofig.id,
        address=[__item.private_ip_address for __item in web][range["value"]].apply(lambda private_ip_addresses: f"{private_ip_addresses}:80"),
        label="mynodebalancernode",
        weight=50))
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

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

Create a NodeBalancerNode Resource

new NodeBalancerNode(name: string, args: NodeBalancerNodeArgs, opts?: CustomResourceOptions);
@overload
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)
@overload
def NodeBalancerNode(resource_name: str,
                     args: NodeBalancerNodeArgs,
                     opts: Optional[ResourceOptions] = None)
func NewNodeBalancerNode(ctx *Context, name string, args NodeBalancerNodeArgs, opts ...ResourceOption) (*NodeBalancerNode, error)
public NodeBalancerNode(string name, NodeBalancerNodeArgs args, CustomResourceOptions? opts = null)
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.
args NodeBalancerNodeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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. (accept, reject, drain, backup)
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.