FloatingIp

Provides a Hetzner Cloud Floating IP to represent a publicly-accessible static IP address that can be mapped to one of your servers.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var node1 = new HCloud.Server("node1", new HCloud.ServerArgs
        {
            Image = "debian-9",
            ServerType = "cx11",
        });
        var master = new HCloud.FloatingIp("master", new HCloud.FloatingIpArgs
        {
            ServerId = node1.Id,
            Type = "ipv4",
        });
    }

}
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 {
        node1, err := hcloud.NewServer(ctx, "node1", &hcloud.ServerArgs{
            Image:      pulumi.String("debian-9"),
            ServerType: pulumi.String("cx11"),
        })
        if err != nil {
            return err
        }
        _, err = hcloud.NewFloatingIp(ctx, "master", &hcloud.FloatingIpArgs{
            ServerId: node1.ID(),
            Type:     pulumi.String("ipv4"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

node1 = hcloud.Server("node1",
    image="debian-9",
    server_type="cx11")
master = hcloud.FloatingIp("master",
    server_id=node1.id,
    type="ipv4")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const node1 = new hcloud.Server("node1", {
    image: "debian-9",
    serverType: "cx11",
});
const master = new hcloud.FloatingIp("master", {
    serverId: node1.id.apply(id => Number.parseFloat(id)),
    type: "ipv4",
});

Create a FloatingIp Resource

def FloatingIp(resource_name, opts=None, description=None, home_location=None, labels=None, name=None, server_id=None, type=None, __props__=None);
func NewFloatingIp(ctx *Context, name string, args FloatingIpArgs, opts ...ResourceOption) (*FloatingIp, error)
public FloatingIp(string name, FloatingIpArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args FloatingIpArgs
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 FloatingIpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FloatingIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

FloatingIp Resource Properties

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

Inputs

The FloatingIp resource accepts the following input properties:

Type string
Description string
HomeLocation string
Labels Dictionary<string, object>
Name string
ServerId int
Type string
Description string
HomeLocation string
Labels map[string]interface{}
Name string
ServerId int
type string
description string
homeLocation string
labels {[key: string]: any}
name string
serverId number
type str
description str
home_location str
labels Dict[str, Any]
name str
server_id float

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
IpNetwork string
Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
IpNetwork string
id string
The provider-assigned unique ID for this managed resource.
ipAddress string
ipNetwork string
id str
The provider-assigned unique ID for this managed resource.
ip_address str
ip_network str

Look up an Existing FloatingIp Resource

Get an existing FloatingIp 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?: FloatingIpState, opts?: CustomResourceOptions): FloatingIp
static get(resource_name, id, opts=None, description=None, home_location=None, ip_address=None, ip_network=None, labels=None, name=None, server_id=None, type=None, __props__=None);
func GetFloatingIp(ctx *Context, name string, id IDInput, state *FloatingIpState, opts ...ResourceOption) (*FloatingIp, error)
public static FloatingIp Get(string name, Input<string> id, FloatingIpState? 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:

Description string
HomeLocation string
IpAddress string
IpNetwork string
Labels Dictionary<string, object>
Name string
ServerId int
Type string
Description string
HomeLocation string
IpAddress string
IpNetwork string
Labels map[string]interface{}
Name string
ServerId int
Type string
description string
homeLocation string
ipAddress string
ipNetwork string
labels {[key: string]: any}
name string
serverId number
type string
description str
home_location str
ip_address str
ip_network str
labels Dict[str, Any]
name str
server_id float
type str

Package Details

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