1. Packages
  2. Hcloud Provider
  3. API Docs
  4. PrimaryIp
Hetzner Cloud v1.22.0 published on Wednesday, Feb 26, 2025 by Pulumi

hcloud.PrimaryIp

Explore with Pulumi AI

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

If a server is getting created, it has to have a primary ip. If a server is getting created without defining primary ips, two of them (one ipv4 and one ipv6) getting created & attached. Currently, Primary IPs can be only attached to servers.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const main = new hcloud.PrimaryIp("main", {
    name: "primary_ip_test",
    datacenter: "fsn1-dc14",
    type: "ipv4",
    assigneeType: "server",
    autoDelete: true,
    labels: {
        hallo: "welt",
    },
});
// Link a server to a primary IP
const serverTest = new hcloud.Server("server_test", {
    name: "test-server",
    image: "ubuntu-20.04",
    serverType: "cx22",
    datacenter: "fsn1-dc14",
    labels: {
        test: "tessst1",
    },
    publicNets: [{
        ipv4: main.id,
    }],
});
Copy
import pulumi
import pulumi_hcloud as hcloud

main = hcloud.PrimaryIp("main",
    name="primary_ip_test",
    datacenter="fsn1-dc14",
    type="ipv4",
    assignee_type="server",
    auto_delete=True,
    labels={
        "hallo": "welt",
    })
# Link a server to a primary IP
server_test = hcloud.Server("server_test",
    name="test-server",
    image="ubuntu-20.04",
    server_type="cx22",
    datacenter="fsn1-dc14",
    labels={
        "test": "tessst1",
    },
    public_nets=[{
        "ipv4": main.id,
    }])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := hcloud.NewPrimaryIp(ctx, "main", &hcloud.PrimaryIpArgs{
			Name:         pulumi.String("primary_ip_test"),
			Datacenter:   pulumi.String("fsn1-dc14"),
			Type:         pulumi.String("ipv4"),
			AssigneeType: pulumi.String("server"),
			AutoDelete:   pulumi.Bool(true),
			Labels: pulumi.StringMap{
				"hallo": pulumi.String("welt"),
			},
		})
		if err != nil {
			return err
		}
		// Link a server to a primary IP
		_, err = hcloud.NewServer(ctx, "server_test", &hcloud.ServerArgs{
			Name:       pulumi.String("test-server"),
			Image:      pulumi.String("ubuntu-20.04"),
			ServerType: pulumi.String("cx22"),
			Datacenter: pulumi.String("fsn1-dc14"),
			Labels: pulumi.StringMap{
				"test": pulumi.String("tessst1"),
			},
			PublicNets: hcloud.ServerPublicNetArray{
				&hcloud.ServerPublicNetArgs{
					Ipv4: main.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;

return await Deployment.RunAsync(() => 
{
    var main = new HCloud.PrimaryIp("main", new()
    {
        Name = "primary_ip_test",
        Datacenter = "fsn1-dc14",
        Type = "ipv4",
        AssigneeType = "server",
        AutoDelete = true,
        Labels = 
        {
            { "hallo", "welt" },
        },
    });

    // Link a server to a primary IP
    var serverTest = new HCloud.Server("server_test", new()
    {
        Name = "test-server",
        Image = "ubuntu-20.04",
        ServerType = "cx22",
        Datacenter = "fsn1-dc14",
        Labels = 
        {
            { "test", "tessst1" },
        },
        PublicNets = new[]
        {
            new HCloud.Inputs.ServerPublicNetArgs
            {
                Ipv4 = main.Id,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.PrimaryIp;
import com.pulumi.hcloud.PrimaryIpArgs;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import com.pulumi.hcloud.inputs.ServerPublicNetArgs;
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) {
        var main = new PrimaryIp("main", PrimaryIpArgs.builder()
            .name("primary_ip_test")
            .datacenter("fsn1-dc14")
            .type("ipv4")
            .assigneeType("server")
            .autoDelete(true)
            .labels(Map.of("hallo", "welt"))
            .build());

        // Link a server to a primary IP
        var serverTest = new Server("serverTest", ServerArgs.builder()
            .name("test-server")
            .image("ubuntu-20.04")
            .serverType("cx22")
            .datacenter("fsn1-dc14")
            .labels(Map.of("test", "tessst1"))
            .publicNets(ServerPublicNetArgs.builder()
                .ipv4(main.id())
                .build())
            .build());

    }
}
Copy
resources:
  main:
    type: hcloud:PrimaryIp
    properties:
      name: primary_ip_test
      datacenter: fsn1-dc14
      type: ipv4
      assigneeType: server
      autoDelete: true
      labels:
        hallo: welt
  # Link a server to a primary IP
  serverTest:
    type: hcloud:Server
    name: server_test
    properties:
      name: test-server
      image: ubuntu-20.04
      serverType: cx22
      datacenter: fsn1-dc14
      labels:
        test: tessst1
      publicNets:
        - ipv4: ${main.id}
Copy

Create PrimaryIp Resource

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

Constructor syntax

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

@overload
def PrimaryIp(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              assignee_type: Optional[str] = None,
              auto_delete: Optional[bool] = None,
              type: Optional[str] = None,
              assignee_id: Optional[int] = None,
              datacenter: Optional[str] = None,
              delete_protection: Optional[bool] = None,
              labels: Optional[Mapping[str, str]] = None,
              name: Optional[str] = None)
func NewPrimaryIp(ctx *Context, name string, args PrimaryIpArgs, opts ...ResourceOption) (*PrimaryIp, error)
public PrimaryIp(string name, PrimaryIpArgs args, CustomResourceOptions? opts = null)
public PrimaryIp(String name, PrimaryIpArgs args)
public PrimaryIp(String name, PrimaryIpArgs args, CustomResourceOptions options)
type: hcloud:PrimaryIp
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 This property is required. PrimaryIpArgs
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 This property is required. PrimaryIpArgs
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 This property is required. PrimaryIpArgs
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 This property is required. PrimaryIpArgs
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. PrimaryIpArgs
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 primaryIpResource = new HCloud.PrimaryIp("primaryIpResource", new()
{
    AssigneeType = "string",
    AutoDelete = false,
    Type = "string",
    AssigneeId = 0,
    Datacenter = "string",
    DeleteProtection = false,
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
});
Copy
example, err := hcloud.NewPrimaryIp(ctx, "primaryIpResource", &hcloud.PrimaryIpArgs{
	AssigneeType:     pulumi.String("string"),
	AutoDelete:       pulumi.Bool(false),
	Type:             pulumi.String("string"),
	AssigneeId:       pulumi.Int(0),
	Datacenter:       pulumi.String("string"),
	DeleteProtection: pulumi.Bool(false),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name: pulumi.String("string"),
})
Copy
var primaryIpResource = new PrimaryIp("primaryIpResource", PrimaryIpArgs.builder()
    .assigneeType("string")
    .autoDelete(false)
    .type("string")
    .assigneeId(0)
    .datacenter("string")
    .deleteProtection(false)
    .labels(Map.of("string", "string"))
    .name("string")
    .build());
Copy
primary_ip_resource = hcloud.PrimaryIp("primaryIpResource",
    assignee_type="string",
    auto_delete=False,
    type="string",
    assignee_id=0,
    datacenter="string",
    delete_protection=False,
    labels={
        "string": "string",
    },
    name="string")
Copy
const primaryIpResource = new hcloud.PrimaryIp("primaryIpResource", {
    assigneeType: "string",
    autoDelete: false,
    type: "string",
    assigneeId: 0,
    datacenter: "string",
    deleteProtection: false,
    labels: {
        string: "string",
    },
    name: "string",
});
Copy
type: hcloud:PrimaryIp
properties:
    assigneeId: 0
    assigneeType: string
    autoDelete: false
    datacenter: string
    deleteProtection: false
    labels:
        string: string
    name: string
    type: string
Copy

PrimaryIp 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 PrimaryIp resource accepts the following input properties:

AssigneeType This property is required. string
The type of the assigned resource. Currently supported: server
AutoDelete This property is required. bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of the Primary IP. ipv4 or ipv6
AssigneeId int
ID of the assigned resource.
Datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
DeleteProtection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

Labels Dictionary<string, string>
User-defined labels (key-value pairs).
Name string
Name of the Primary IP.
AssigneeType This property is required. string
The type of the assigned resource. Currently supported: server
AutoDelete This property is required. bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of the Primary IP. ipv4 or ipv6
AssigneeId int
ID of the assigned resource.
Datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
DeleteProtection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

Labels map[string]string
User-defined labels (key-value pairs).
Name string
Name of the Primary IP.
assigneeType This property is required. String
The type of the assigned resource. Currently supported: server
autoDelete This property is required. Boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
type
This property is required.
Changes to this property will trigger replacement.
String
Type of the Primary IP. ipv4 or ipv6
assigneeId Integer
ID of the assigned resource.
datacenter Changes to this property will trigger replacement. String
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection Boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

labels Map<String,String>
User-defined labels (key-value pairs).
name String
Name of the Primary IP.
assigneeType This property is required. string
The type of the assigned resource. Currently supported: server
autoDelete This property is required. boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
type
This property is required.
Changes to this property will trigger replacement.
string
Type of the Primary IP. ipv4 or ipv6
assigneeId number
ID of the assigned resource.
datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

labels {[key: string]: string}
User-defined labels (key-value pairs).
name string
Name of the Primary IP.
assignee_type This property is required. str
The type of the assigned resource. Currently supported: server
auto_delete This property is required. bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
type
This property is required.
Changes to this property will trigger replacement.
str
Type of the Primary IP. ipv4 or ipv6
assignee_id int
ID of the assigned resource.
datacenter Changes to this property will trigger replacement. str
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
delete_protection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

labels Mapping[str, str]
User-defined labels (key-value pairs).
name str
Name of the Primary IP.
assigneeType This property is required. String
The type of the assigned resource. Currently supported: server
autoDelete This property is required. Boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
type
This property is required.
Changes to this property will trigger replacement.
String
Type of the Primary IP. ipv4 or ipv6
assigneeId Number
ID of the assigned resource.
datacenter Changes to this property will trigger replacement. String
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection Boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

labels Map<String>
User-defined labels (key-value pairs).
name String
Name of the Primary IP.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
(string) IP Address of the Primary IP.
IpNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
(string) IP Address of the Primary IP.
IpNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
(string) IP Address of the Primary IP.
ipNetwork String
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
id string
The provider-assigned unique ID for this managed resource.
ipAddress string
(string) IP Address of the Primary IP.
ipNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
id str
The provider-assigned unique ID for this managed resource.
ip_address str
(string) IP Address of the Primary IP.
ip_network str
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
(string) IP Address of the Primary IP.
ipNetwork String
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)

Look up Existing PrimaryIp Resource

Get an existing PrimaryIp 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?: PrimaryIpState, opts?: CustomResourceOptions): PrimaryIp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        assignee_id: Optional[int] = None,
        assignee_type: Optional[str] = None,
        auto_delete: Optional[bool] = None,
        datacenter: Optional[str] = None,
        delete_protection: Optional[bool] = None,
        ip_address: Optional[str] = None,
        ip_network: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        type: Optional[str] = None) -> PrimaryIp
func GetPrimaryIp(ctx *Context, name string, id IDInput, state *PrimaryIpState, opts ...ResourceOption) (*PrimaryIp, error)
public static PrimaryIp Get(string name, Input<string> id, PrimaryIpState? state, CustomResourceOptions? opts = null)
public static PrimaryIp get(String name, Output<String> id, PrimaryIpState state, CustomResourceOptions options)
resources:  _:    type: hcloud:PrimaryIp    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:
AssigneeId int
ID of the assigned resource.
AssigneeType string
The type of the assigned resource. Currently supported: server
AutoDelete bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
Datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
DeleteProtection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

IpAddress string
(string) IP Address of the Primary IP.
IpNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
Labels Dictionary<string, string>
User-defined labels (key-value pairs).
Name string
Name of the Primary IP.
Type Changes to this property will trigger replacement. string
Type of the Primary IP. ipv4 or ipv6
AssigneeId int
ID of the assigned resource.
AssigneeType string
The type of the assigned resource. Currently supported: server
AutoDelete bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
Datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
DeleteProtection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

IpAddress string
(string) IP Address of the Primary IP.
IpNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
Labels map[string]string
User-defined labels (key-value pairs).
Name string
Name of the Primary IP.
Type Changes to this property will trigger replacement. string
Type of the Primary IP. ipv4 or ipv6
assigneeId Integer
ID of the assigned resource.
assigneeType String
The type of the assigned resource. Currently supported: server
autoDelete Boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
datacenter Changes to this property will trigger replacement. String
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection Boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

ipAddress String
(string) IP Address of the Primary IP.
ipNetwork String
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
labels Map<String,String>
User-defined labels (key-value pairs).
name String
Name of the Primary IP.
type Changes to this property will trigger replacement. String
Type of the Primary IP. ipv4 or ipv6
assigneeId number
ID of the assigned resource.
assigneeType string
The type of the assigned resource. Currently supported: server
autoDelete boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
datacenter Changes to this property will trigger replacement. string
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

ipAddress string
(string) IP Address of the Primary IP.
ipNetwork string
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
labels {[key: string]: string}
User-defined labels (key-value pairs).
name string
Name of the Primary IP.
type Changes to this property will trigger replacement. string
Type of the Primary IP. ipv4 or ipv6
assignee_id int
ID of the assigned resource.
assignee_type str
The type of the assigned resource. Currently supported: server
auto_delete bool
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
datacenter Changes to this property will trigger replacement. str
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
delete_protection bool

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

ip_address str
(string) IP Address of the Primary IP.
ip_network str
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
labels Mapping[str, str]
User-defined labels (key-value pairs).
name str
Name of the Primary IP.
type Changes to this property will trigger replacement. str
Type of the Primary IP. ipv4 or ipv6
assigneeId Number
ID of the assigned resource.
assigneeType String
The type of the assigned resource. Currently supported: server
autoDelete Boolean
Whether auto delete is enabled. Important note:It is recommended to set auto_delete to false, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the TF state.
datacenter Changes to this property will trigger replacement. String
The datacenter name to create the resource in. See the Hetzner Docs for more details about datacenters.
deleteProtection Boolean

Whether delete protection is enabled. See "Delete Protection" in the Provider Docs for details.

Note: At least one of datacenter or assignee_id is required.

ipAddress String
(string) IP Address of the Primary IP.
ipNetwork String
(string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if type is ipv6)
labels Map<String>
User-defined labels (key-value pairs).
name String
Name of the Primary IP.
type Changes to this property will trigger replacement. String
Type of the Primary IP. ipv4 or ipv6

Import

Primary IPs can be imported using its id:

$ pulumi import hcloud:index/primaryIp:PrimaryIp example "$PRIMARY_IP_ID"
Copy

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

Package Details

Repository
Hetzner Cloud pulumi/pulumi-hcloud
License
Apache-2.0
Notes
This Pulumi package is based on the hcloud Terraform Provider.