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
new NodeBalancerNode(name: string, args: NodeBalancerNodeArgs, opts?: CustomResourceOptions);def NodeBalancerNode(resource_name, opts=None, address=None, config_id=None, label=None, mode=None, nodebalancer_id=None, weight=None, __props__=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.
- 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.
- Config
Id int The ID of the NodeBalancerConfig to access.
- Label string
The label of the Linode NodeBalancer Node. This is for display purposes only.
- Nodebalancer
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis 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.
- Config
Id int The ID of the NodeBalancerConfig to access.
- Label string
The label of the Linode NodeBalancer Node. This is for display purposes only.
- Nodebalancer
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis 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.
- config
Id number The ID of the NodeBalancerConfig to access.
- label string
The label of the Linode NodeBalancer Node. This is for display purposes only.
- nodebalancer
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis 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 float The ID of the NodeBalancerConfig to access.
- label str
The label of the Linode NodeBalancer Node. This is for display purposes only.
- nodebalancer_
id float The ID of the NodeBalancer to access.
- mode str
The mode this NodeBalancer should use when sending traffic to this backend. If set to
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis backend will not receive new traffic, but connections already pinned to it will continue to be routed to it- weight float
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:
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): NodeBalancerNodestatic get(resource_name, id, opts=None, address=None, config_id=None, label=None, mode=None, nodebalancer_id=None, status=None, weight=None, __props__=None);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.
- Config
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis 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 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.
- Config
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis 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 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.
- config
Id 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis backend will not receive new traffic, but connections already pinned to it will continue to be routed to it- nodebalancer
Id 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 float 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
acceptthis backend is accepting traffic. If set torejectthis backend will not receive traffic. If set todrainthis backend will not receive new traffic, but connections already pinned to it will continue to be routed to it- nodebalancer_
id float 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 float
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).
Package Details
- Repository
- https://github.com/pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linodeTerraform Provider.