Viewing docs for Hetzner Cloud v1.42.0
published on Saturday, Sep 12, 2026 by Pulumi
published on Saturday, Sep 12, 2026 by Pulumi
Viewing docs for Hetzner Cloud v1.42.0
published on Saturday, Sep 12, 2026 by Pulumi
published on Saturday, Sep 12, 2026 by Pulumi
Provides a list of Hetzner Cloud Primary IPs.
See the Primary IPs API documentation for more details.
Deprecations
datacenter attribute
The datacenter attribute is marked for removal since v1.67.0, you must use the location attribute instead.
See our deprecation and removal changelog for more details.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const ip2 = hcloud.getPrimaryIps({
withSelector: "key=value",
});
import pulumi
import pulumi_hcloud as hcloud
ip2 = hcloud.get_primary_ips(with_selector="key=value")
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 {
_, err := hcloud.GetPrimaryIps(ctx, &hcloud.GetPrimaryIpsArgs{
WithSelector: pulumi.StringRef("key=value"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var ip2 = HCloud.GetPrimaryIps.Invoke(new()
{
WithSelector = "key=value",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.HcloudFunctions;
import com.pulumi.hcloud.inputs.GetPrimaryIpsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
final var ip2 = HcloudFunctions.getPrimaryIps(GetPrimaryIpsArgs.builder()
.withSelector("key=value")
.build());
}
}
variables:
ip2:
fn::invoke:
function: hcloud:getPrimaryIps
arguments:
withSelector: key=value
pulumi {
required_providers {
hcloud = {
source = "pulumi/hcloud"
}
}
}
data "hcloud_getprimaryips" "ip2" {
with_selector = "key=value"
}
Using getPrimaryIps
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPrimaryIps(args: GetPrimaryIpsArgs, opts?: InvokeOptions): Promise<GetPrimaryIpsResult>
function getPrimaryIpsOutput(args: GetPrimaryIpsOutputArgs, opts?: InvokeOutputOptions): Output<GetPrimaryIpsResult>def get_primary_ips(id: Optional[str] = None,
with_selector: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPrimaryIpsResult
def get_primary_ips_output(id: pulumi.Input[Optional[str]] = None,
with_selector: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetPrimaryIpsResult]func GetPrimaryIps(ctx *Context, args *GetPrimaryIpsArgs, opts ...InvokeOption) (*GetPrimaryIpsResult, error)
func GetPrimaryIpsOutput(ctx *Context, args *GetPrimaryIpsOutputArgs, opts ...InvokeOption) GetPrimaryIpsResultOutput> Note: This function is named GetPrimaryIps in the Go SDK.
public static class GetPrimaryIps
{
public static Task<GetPrimaryIpsResult> InvokeAsync(GetPrimaryIpsArgs args, InvokeOptions? opts = null)
public static Output<GetPrimaryIpsResult> Invoke(GetPrimaryIpsInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetPrimaryIpsResult> Invoke(GetPrimaryIpsInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetPrimaryIpsResult> getPrimaryIps(GetPrimaryIpsArgs args, InvokeOptions options)
public static Output<GetPrimaryIpsResult> getPrimaryIps(GetPrimaryIpsArgs args, InvokeOptions options)
public static Output<GetPrimaryIpsResult> getPrimaryIps(GetPrimaryIpsArgs args, InvokeOutputOptions options)
fn::invoke:
function: hcloud:index/getPrimaryIps:getPrimaryIps
arguments:
# arguments dictionarydata "hcloud_get_primary_ips" "name" {
# arguments
}The following arguments are supported:
- Id string
- The ID of this resource.
- With
Selector string - Filter results using a Label Selector
- Id string
- The ID of this resource.
- With
Selector string - Filter results using a Label Selector
- id string
- The ID of this resource.
- with_
selector string - Filter results using a Label Selector
- id String
- The ID of this resource.
- with
Selector String - Filter results using a Label Selector
- id string
- The ID of this resource.
- with
Selector string - Filter results using a Label Selector
- id str
- The ID of this resource.
- with_
selector str - Filter results using a Label Selector
- id String
- The ID of this resource.
- with
Selector String - Filter results using a Label Selector
getPrimaryIps Result
The following output properties are available:
- Id string
- The ID of this resource.
- Primary
Ips List<Pulumi.HCloud. Outputs. Get Primary Ips Primary Ip> - With
Selector string - Filter results using a Label Selector
- Id string
- The ID of this resource.
- Primary
Ips []GetPrimary Ips Primary Ip - With
Selector string - Filter results using a Label Selector
- id string
- The ID of this resource.
- primary_
ips list(object) - with_
selector string - Filter results using a Label Selector
- id String
- The ID of this resource.
- primary
Ips List<GetPrimary Ips Primary Ip> - with
Selector String - Filter results using a Label Selector
- id string
- The ID of this resource.
- primary
Ips GetPrimary Ips Primary Ip[] - with
Selector string - Filter results using a Label Selector
- id str
- The ID of this resource.
- primary_
ips Sequence[GetPrimary Ips Primary Ip] - with_
selector str - Filter results using a Label Selector
- id String
- The ID of this resource.
- primary
Ips List<Property Map> - with
Selector String - Filter results using a Label Selector
Supporting Types
GetPrimaryIpsPrimaryIp
- Assignee
Id int - ID of the resource the Primary IP is assigned to.
- Assignee
Type string - Type of the resource the Primary IP is assigned to.
- Auto
Delete bool - Whether auto delete is enabled.
- Datacenter string
- Name of the Datacenter of the Primary IP.
- Delete
Protection bool - Whether delete protection is enabled.
- Id int
- ID of the Primary IP.
- Ip
Address string - IP address of the Primary IP.
- Ip
Network string - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - Labels Dictionary<string, string>
- User-defined labels (key-value pairs) for the resource.
- Location string
- Name of the Location of the Primary IP.
- Name string
- Name of the Primary IP.
- Type string
- Type of the Primary IP (
ipv4oripv6).
- Assignee
Id int - ID of the resource the Primary IP is assigned to.
- Assignee
Type string - Type of the resource the Primary IP is assigned to.
- Auto
Delete bool - Whether auto delete is enabled.
- Datacenter string
- Name of the Datacenter of the Primary IP.
- Delete
Protection bool - Whether delete protection is enabled.
- Id int
- ID of the Primary IP.
- Ip
Address string - IP address of the Primary IP.
- Ip
Network string - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - Labels map[string]string
- User-defined labels (key-value pairs) for the resource.
- Location string
- Name of the Location of the Primary IP.
- Name string
- Name of the Primary IP.
- Type string
- Type of the Primary IP (
ipv4oripv6).
- assignee_
id number - ID of the resource the Primary IP is assigned to.
- assignee_
type string - Type of the resource the Primary IP is assigned to.
- auto_
delete bool - Whether auto delete is enabled.
- datacenter string
- Name of the Datacenter of the Primary IP.
- delete_
protection bool - Whether delete protection is enabled.
- id number
- ID of the Primary IP.
- ip_
address string - IP address of the Primary IP.
- ip_
network string - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - labels map(string)
- User-defined labels (key-value pairs) for the resource.
- location string
- Name of the Location of the Primary IP.
- name string
- Name of the Primary IP.
- type string
- Type of the Primary IP (
ipv4oripv6).
- assignee
Id Integer - ID of the resource the Primary IP is assigned to.
- assignee
Type String - Type of the resource the Primary IP is assigned to.
- auto
Delete Boolean - Whether auto delete is enabled.
- datacenter String
- Name of the Datacenter of the Primary IP.
- delete
Protection Boolean - Whether delete protection is enabled.
- id Integer
- ID of the Primary IP.
- ip
Address String - IP address of the Primary IP.
- ip
Network String - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - labels Map<String,String>
- User-defined labels (key-value pairs) for the resource.
- location String
- Name of the Location of the Primary IP.
- name String
- Name of the Primary IP.
- type String
- Type of the Primary IP (
ipv4oripv6).
- assignee
Id number - ID of the resource the Primary IP is assigned to.
- assignee
Type string - Type of the resource the Primary IP is assigned to.
- auto
Delete boolean - Whether auto delete is enabled.
- datacenter string
- Name of the Datacenter of the Primary IP.
- delete
Protection boolean - Whether delete protection is enabled.
- id number
- ID of the Primary IP.
- ip
Address string - IP address of the Primary IP.
- ip
Network string - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - labels {[key: string]: string}
- User-defined labels (key-value pairs) for the resource.
- location string
- Name of the Location of the Primary IP.
- name string
- Name of the Primary IP.
- type string
- Type of the Primary IP (
ipv4oripv6).
- assignee_
id int - ID of the resource the Primary IP is assigned to.
- assignee_
type str - Type of the resource the Primary IP is assigned to.
- auto_
delete bool - Whether auto delete is enabled.
- datacenter str
- Name of the Datacenter of the Primary IP.
- delete_
protection bool - Whether delete protection is enabled.
- id int
- ID of the Primary IP.
- ip_
address str - IP address of the Primary IP.
- ip_
network str - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - labels Mapping[str, str]
- User-defined labels (key-value pairs) for the resource.
- location str
- Name of the Location of the Primary IP.
- name str
- Name of the Primary IP.
- type str
- Type of the Primary IP (
ipv4oripv6).
- assignee
Id Number - ID of the resource the Primary IP is assigned to.
- assignee
Type String - Type of the resource the Primary IP is assigned to.
- auto
Delete Boolean - Whether auto delete is enabled.
- datacenter String
- Name of the Datacenter of the Primary IP.
- delete
Protection Boolean - Whether delete protection is enabled.
- id Number
- ID of the Primary IP.
- ip
Address String - IP address of the Primary IP.
- ip
Network String - IP network of the Primary IP for IPv6 addresses. Only set if
typeisipv6. - labels Map<String>
- User-defined labels (key-value pairs) for the resource.
- location String
- Name of the Location of the Primary IP.
- name String
- Name of the Primary IP.
- type String
- Type of the Primary IP (
ipv4oripv6).
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloudTerraform Provider.
Viewing docs for Hetzner Cloud v1.42.0
published on Saturday, Sep 12, 2026 by Pulumi
published on Saturday, Sep 12, 2026 by Pulumi