1. Packages
  2. UpCloud
  3. API Docs
  4. FloatingIpAddress
UpCloud v0.2.0 published on Wednesday, Apr 16, 2025 by UpCloudLtd

upcloud.FloatingIpAddress

Explore with Pulumi AI

This resource represents a UpCloud floating IP address resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";

// Create a detached floating IP address.
const myFloatingAddress = new upcloud.FloatingIpAddress("my_floating_address", {zone: "de-fra1"});
// Floating IP address assigned to a server resource.
const example = new upcloud.Server("example", {
    hostname: "terraform.example.tld",
    zone: "de-fra1",
    plan: "1xCPU-1GB",
    template: {
        storage: "Ubuntu Server 20.04 LTS (Focal Fossa)",
        size: 25,
    },
    networkInterfaces: [{
        type: "public",
    }],
});
const myNewFloatingAddress = new upcloud.FloatingIpAddress("my_new_floating_address", {macAddress: example.networkInterfaces.apply(networkInterfaces => networkInterfaces?.[0]?.macAddress)});
Copy
import pulumi
import pulumi_upcloud as upcloud

# Create a detached floating IP address.
my_floating_address = upcloud.FloatingIpAddress("my_floating_address", zone="de-fra1")
# Floating IP address assigned to a server resource.
example = upcloud.Server("example",
    hostname="terraform.example.tld",
    zone="de-fra1",
    plan="1xCPU-1GB",
    template={
        "storage": "Ubuntu Server 20.04 LTS (Focal Fossa)",
        "size": 25,
    },
    network_interfaces=[{
        "type": "public",
    }])
my_new_floating_address = upcloud.FloatingIpAddress("my_new_floating_address", mac_address=example.network_interfaces[0].mac_address)
Copy
package main

import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a detached floating IP address.
		_, err := upcloud.NewFloatingIpAddress(ctx, "my_floating_address", &upcloud.FloatingIpAddressArgs{
			Zone: pulumi.String("de-fra1"),
		})
		if err != nil {
			return err
		}
		// Floating IP address assigned to a server resource.
		example, err := upcloud.NewServer(ctx, "example", &upcloud.ServerArgs{
			Hostname: pulumi.String("terraform.example.tld"),
			Zone:     pulumi.String("de-fra1"),
			Plan:     pulumi.String("1xCPU-1GB"),
			Template: &upcloud.ServerTemplateArgs{
				Storage: pulumi.String("Ubuntu Server 20.04 LTS (Focal Fossa)"),
				Size:    pulumi.Int(25),
			},
			NetworkInterfaces: upcloud.ServerNetworkInterfaceArray{
				&upcloud.ServerNetworkInterfaceArgs{
					Type: pulumi.String("public"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewFloatingIpAddress(ctx, "my_new_floating_address", &upcloud.FloatingIpAddressArgs{
			MacAddress: pulumi.String(example.NetworkInterfaces.ApplyT(func(networkInterfaces []upcloud.ServerNetworkInterface) (*string, error) {
				return &networkInterfaces[0].MacAddress, nil
			}).(pulumi.StringPtrOutput)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    // Create a detached floating IP address.
    var myFloatingAddress = new UpCloud.FloatingIpAddress("my_floating_address", new()
    {
        Zone = "de-fra1",
    });

    // Floating IP address assigned to a server resource.
    var example = new UpCloud.Server("example", new()
    {
        Hostname = "terraform.example.tld",
        Zone = "de-fra1",
        Plan = "1xCPU-1GB",
        Template = new UpCloud.Inputs.ServerTemplateArgs
        {
            Storage = "Ubuntu Server 20.04 LTS (Focal Fossa)",
            Size = 25,
        },
        NetworkInterfaces = new[]
        {
            new UpCloud.Inputs.ServerNetworkInterfaceArgs
            {
                Type = "public",
            },
        },
    });

    var myNewFloatingAddress = new UpCloud.FloatingIpAddress("my_new_floating_address", new()
    {
        MacAddress = example.NetworkInterfaces.Apply(networkInterfaces => networkInterfaces[0]?.MacAddress),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.FloatingIpAddress;
import com.pulumi.upcloud.FloatingIpAddressArgs;
import com.pulumi.upcloud.Server;
import com.pulumi.upcloud.ServerArgs;
import com.pulumi.upcloud.inputs.ServerTemplateArgs;
import com.pulumi.upcloud.inputs.ServerNetworkInterfaceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Create a detached floating IP address.
        var myFloatingAddress = new FloatingIpAddress("myFloatingAddress", FloatingIpAddressArgs.builder()
            .zone("de-fra1")
            .build());

        // Floating IP address assigned to a server resource.
        var example = new Server("example", ServerArgs.builder()
            .hostname("terraform.example.tld")
            .zone("de-fra1")
            .plan("1xCPU-1GB")
            .template(ServerTemplateArgs.builder()
                .storage("Ubuntu Server 20.04 LTS (Focal Fossa)")
                .size(25)
                .build())
            .networkInterfaces(ServerNetworkInterfaceArgs.builder()
                .type("public")
                .build())
            .build());

        var myNewFloatingAddress = new FloatingIpAddress("myNewFloatingAddress", FloatingIpAddressArgs.builder()
            .macAddress(example.networkInterfaces().applyValue(_networkInterfaces -> _networkInterfaces[0].macAddress()))
            .build());

    }
}
Copy
resources:
  # Create a detached floating IP address.
  myFloatingAddress:
    type: upcloud:FloatingIpAddress
    name: my_floating_address
    properties:
      zone: de-fra1
  # Floating IP address assigned to a server resource.
  example:
    type: upcloud:Server
    properties:
      hostname: terraform.example.tld
      zone: de-fra1
      plan: 1xCPU-1GB
      template:
        storage: Ubuntu Server 20.04 LTS (Focal Fossa)
        size: 25
      networkInterfaces:
        - type: public
  myNewFloatingAddress:
    type: upcloud:FloatingIpAddress
    name: my_new_floating_address
    properties:
      macAddress: ${example.networkInterfaces[0].macAddress}
Copy

Create FloatingIpAddress Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new FloatingIpAddress(name: string, args?: FloatingIpAddressArgs, opts?: CustomResourceOptions);
@overload
def FloatingIpAddress(resource_name: str,
                      args: Optional[FloatingIpAddressArgs] = None,
                      opts: Optional[ResourceOptions] = None)

@overload
def FloatingIpAddress(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      access: Optional[str] = None,
                      family: Optional[str] = None,
                      mac_address: Optional[str] = None,
                      zone: Optional[str] = None)
func NewFloatingIpAddress(ctx *Context, name string, args *FloatingIpAddressArgs, opts ...ResourceOption) (*FloatingIpAddress, error)
public FloatingIpAddress(string name, FloatingIpAddressArgs? args = null, CustomResourceOptions? opts = null)
public FloatingIpAddress(String name, FloatingIpAddressArgs args)
public FloatingIpAddress(String name, FloatingIpAddressArgs args, CustomResourceOptions options)
type: upcloud:FloatingIpAddress
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args FloatingIpAddressArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args FloatingIpAddressArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args FloatingIpAddressArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args FloatingIpAddressArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. FloatingIpAddressArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var floatingIpAddressResource = new UpCloud.FloatingIpAddress("floatingIpAddressResource", new()
{
    Access = "string",
    Family = "string",
    MacAddress = "string",
    Zone = "string",
});
Copy
example, err := upcloud.NewFloatingIpAddress(ctx, "floatingIpAddressResource", &upcloud.FloatingIpAddressArgs{
	Access:     pulumi.String("string"),
	Family:     pulumi.String("string"),
	MacAddress: pulumi.String("string"),
	Zone:       pulumi.String("string"),
})
Copy
var floatingIpAddressResource = new FloatingIpAddress("floatingIpAddressResource", FloatingIpAddressArgs.builder()
    .access("string")
    .family("string")
    .macAddress("string")
    .zone("string")
    .build());
Copy
floating_ip_address_resource = upcloud.FloatingIpAddress("floatingIpAddressResource",
    access="string",
    family="string",
    mac_address="string",
    zone="string")
Copy
const floatingIpAddressResource = new upcloud.FloatingIpAddress("floatingIpAddressResource", {
    access: "string",
    family: "string",
    macAddress: "string",
    zone: "string",
});
Copy
type: upcloud:FloatingIpAddress
properties:
    access: string
    family: string
    macAddress: string
    zone: string
Copy

FloatingIpAddress Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The FloatingIpAddress resource accepts the following input properties:

Access string
Network access for the floating IP address. Supported value: public.
Family string
The address family of the floating IP address.
MacAddress string
MAC address of a server interface to assign address to.
Zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
Access string
Network access for the floating IP address. Supported value: public.
Family string
The address family of the floating IP address.
MacAddress string
MAC address of a server interface to assign address to.
Zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access String
Network access for the floating IP address. Supported value: public.
family String
The address family of the floating IP address.
macAddress String
MAC address of a server interface to assign address to.
zone String
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access string
Network access for the floating IP address. Supported value: public.
family string
The address family of the floating IP address.
macAddress string
MAC address of a server interface to assign address to.
zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access str
Network access for the floating IP address. Supported value: public.
family str
The address family of the floating IP address.
mac_address str
MAC address of a server interface to assign address to.
zone str
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access String
Network access for the floating IP address. Supported value: public.
family String
The address family of the floating IP address.
macAddress String
MAC address of a server interface to assign address to.
zone String
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
An UpCloud assigned IP Address.
Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
An UpCloud assigned IP Address.
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
An UpCloud assigned IP Address.
id string
The provider-assigned unique ID for this managed resource.
ipAddress string
An UpCloud assigned IP Address.
id str
The provider-assigned unique ID for this managed resource.
ip_address str
An UpCloud assigned IP Address.
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
An UpCloud assigned IP Address.

Look up Existing FloatingIpAddress Resource

Get an existing FloatingIpAddress 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?: FloatingIpAddressState, opts?: CustomResourceOptions): FloatingIpAddress
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access: Optional[str] = None,
        family: Optional[str] = None,
        ip_address: Optional[str] = None,
        mac_address: Optional[str] = None,
        zone: Optional[str] = None) -> FloatingIpAddress
func GetFloatingIpAddress(ctx *Context, name string, id IDInput, state *FloatingIpAddressState, opts ...ResourceOption) (*FloatingIpAddress, error)
public static FloatingIpAddress Get(string name, Input<string> id, FloatingIpAddressState? state, CustomResourceOptions? opts = null)
public static FloatingIpAddress get(String name, Output<String> id, FloatingIpAddressState state, CustomResourceOptions options)
resources:  _:    type: upcloud:FloatingIpAddress    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Access string
Network access for the floating IP address. Supported value: public.
Family string
The address family of the floating IP address.
IpAddress string
An UpCloud assigned IP Address.
MacAddress string
MAC address of a server interface to assign address to.
Zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
Access string
Network access for the floating IP address. Supported value: public.
Family string
The address family of the floating IP address.
IpAddress string
An UpCloud assigned IP Address.
MacAddress string
MAC address of a server interface to assign address to.
Zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access String
Network access for the floating IP address. Supported value: public.
family String
The address family of the floating IP address.
ipAddress String
An UpCloud assigned IP Address.
macAddress String
MAC address of a server interface to assign address to.
zone String
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access string
Network access for the floating IP address. Supported value: public.
family string
The address family of the floating IP address.
ipAddress string
An UpCloud assigned IP Address.
macAddress string
MAC address of a server interface to assign address to.
zone string
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access str
Network access for the floating IP address. Supported value: public.
family str
The address family of the floating IP address.
ip_address str
An UpCloud assigned IP Address.
mac_address str
MAC address of a server interface to assign address to.
zone str
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.
access String
Network access for the floating IP address. Supported value: public.
family String
The address family of the floating IP address.
ipAddress String
An UpCloud assigned IP Address.
macAddress String
MAC address of a server interface to assign address to.
zone String
Zone of the address, e.g. de-fra1. Required when assigning a detached floating IP address. You can list available zones with upctl zone list.

Import

$ pulumi import upcloud:index/floatingIpAddress:FloatingIpAddress my_new_floating_address 94.237.114.205
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
upcloud UpCloudLtd/pulumi-upcloud
License
Apache-2.0
Notes
This Pulumi package is based on the upcloud Terraform Provider.