LoadBalancerNetwork

Provides a Hetzner Cloud Load Balancer Network to represent a private network on a Load Balancer in the Hetzner Cloud.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var lb1 = new HCloud.LoadBalancer("lb1", new HCloud.LoadBalancerArgs
        {
            LoadBalancerType = "lb11",
            NetworkZone = "eu-central",
        });
        var mynet = new HCloud.Network("mynet", new HCloud.NetworkArgs
        {
            IpRange = "10.0.0.0/8",
        });
        var foonet = new HCloud.NetworkSubnet("foonet", new HCloud.NetworkSubnetArgs
        {
            IpRange = "10.0.1.0/24",
            NetworkId = mynet.Id,
            NetworkZone = "eu-central",
            Type = "cloud",
        });
        var srvnetwork = new HCloud.LoadBalancerNetwork("srvnetwork", new HCloud.LoadBalancerNetworkArgs
        {
            Ip = "10.0.1.5",
            LoadBalancerId = lb1.Id,
            NetworkId = mynet.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        lb1, err := hcloud.NewLoadBalancer(ctx, "lb1", &hcloud.LoadBalancerArgs{
            LoadBalancerType: pulumi.String("lb11"),
            NetworkZone:      pulumi.String("eu-central"),
        })
        if err != nil {
            return err
        }
        mynet, err := hcloud.NewNetwork(ctx, "mynet", &hcloud.NetworkArgs{
            IpRange: pulumi.String("10.0.0.0/8"),
        })
        if err != nil {
            return err
        }
        _, err = hcloud.NewNetworkSubnet(ctx, "foonet", &hcloud.NetworkSubnetArgs{
            IpRange:     pulumi.String("10.0.1.0/24"),
            NetworkId:   mynet.ID(),
            NetworkZone: pulumi.String("eu-central"),
            Type:        pulumi.String("cloud"),
        })
        if err != nil {
            return err
        }
        _, err = hcloud.NewLoadBalancerNetwork(ctx, "srvnetwork", &hcloud.LoadBalancerNetworkArgs{
            Ip:             pulumi.String("10.0.1.5"),
            LoadBalancerId: lb1.ID(),
            NetworkId:      mynet.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

lb1 = hcloud.LoadBalancer("lb1",
    load_balancer_type="lb11",
    network_zone="eu-central")
mynet = hcloud.Network("mynet", ip_range="10.0.0.0/8")
foonet = hcloud.NetworkSubnet("foonet",
    ip_range="10.0.1.0/24",
    network_id=mynet.id,
    network_zone="eu-central",
    type="cloud")
srvnetwork = hcloud.LoadBalancerNetwork("srvnetwork",
    ip="10.0.1.5",
    load_balancer_id=lb1.id,
    network_id=mynet.id)
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const lb1 = new hcloud.LoadBalancer("lb1", {
    loadBalancerType: "lb11",
    networkZone: "eu-central",
});
const mynet = new hcloud.Network("mynet", {
    ipRange: "10.0.0.0/8",
});
const foonet = new hcloud.NetworkSubnet("foonet", {
    ipRange: "10.0.1.0/24",
    networkId: mynet.id.apply(id => Number.parseFloat(id)),
    networkZone: "eu-central",
    type: "cloud",
});
const srvnetwork = new hcloud.LoadBalancerNetwork("srvnetwork", {
    ip: "10.0.1.5",
    loadBalancerId: lb1.id.apply(id => Number.parseFloat(id)),
    networkId: mynet.id.apply(id => Number.parseFloat(id)),
});

Create a LoadBalancerNetwork Resource

def LoadBalancerNetwork(resource_name, opts=None, enable_public_interface=None, ip=None, load_balancer_id=None, network_id=None, __props__=None);
name string
The unique name of the resource.
args LoadBalancerNetworkArgs
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 LoadBalancerNetworkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args LoadBalancerNetworkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

LoadBalancerNetwork Resource Properties

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

Inputs

The LoadBalancerNetwork resource accepts the following input properties:

LoadBalancerId int
NetworkId int
EnablePublicInterface bool
Ip string
LoadBalancerId int
NetworkId int
EnablePublicInterface bool
Ip string
loadBalancerId number
networkId number
enablePublicInterface boolean
ip string
load_balancer_id float
network_id float
enable_public_interface bool
ip str

Outputs

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

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

Look up an Existing LoadBalancerNetwork Resource

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

static get(resource_name, id, opts=None, enable_public_interface=None, ip=None, load_balancer_id=None, network_id=None, __props__=None);
func GetLoadBalancerNetwork(ctx *Context, name string, id IDInput, state *LoadBalancerNetworkState, opts ...ResourceOption) (*LoadBalancerNetwork, error)
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:

EnablePublicInterface bool
Ip string
LoadBalancerId int
NetworkId int
EnablePublicInterface bool
Ip string
LoadBalancerId int
NetworkId int
enablePublicInterface boolean
ip string
loadBalancerId number
networkId number
enable_public_interface bool
ip str
load_balancer_id float
network_id float

Package Details

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