1. Packages
  2. Packages
  3. Hcloud Provider
  4. API Docs
  5. getPrimaryIps
Viewing docs for Hetzner Cloud v1.34.0
published on Wednesday, Apr 29, 2026 by Pulumi
hcloud logo
Viewing docs for Hetzner Cloud v1.34.0
published on Wednesday, Apr 29, 2026 by Pulumi

    Provides details about multiple Hetzner Cloud Primary IPs.

    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.Index.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.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) {
            final var ip2 = HcloudFunctions.getPrimaryIps(GetPrimaryIpsArgs.builder()
                .withSelector("key=value")
                .build());
    
        }
    }
    
    variables:
      ip2:
        fn::invoke:
          function: hcloud:getPrimaryIps
          arguments:
            withSelector: 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?: InvokeOptions): 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[InvokeOptions] = 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 CompletableFuture<GetPrimaryIpsResult> getPrimaryIps(GetPrimaryIpsArgs args, InvokeOptions options)
    public static Output<GetPrimaryIpsResult> getPrimaryIps(GetPrimaryIpsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hcloud:index/getPrimaryIps:getPrimaryIps
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getPrimaryIps Result

    The following output properties are available:

    Id string
    PrimaryIps List<Pulumi.HCloud.Outputs.GetPrimaryIpsPrimaryIp>
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    WithSelector string
    Id string
    PrimaryIps []GetPrimaryIpsPrimaryIp
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    WithSelector string
    id String
    primaryIps List<GetPrimaryIpsPrimaryIp>
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    withSelector String
    id string
    primaryIps GetPrimaryIpsPrimaryIp[]
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    withSelector string
    id str
    primary_ips Sequence[GetPrimaryIpsPrimaryIp]
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    with_selector str
    id String
    primaryIps List<Property Map>
    (list) List of all matching primary ips. See data.hcloud_primary_ip for schema.
    withSelector String

    Supporting Types

    GetPrimaryIpsPrimaryIp

    AssigneeId int
    ID of the resource the Primary IP is assigned to.
    AssigneeType string
    Type of the resource the Primary IP is assigned to.
    AutoDelete bool
    Whether auto delete is enabled.
    Datacenter string
    Name of the Datacenter of the Primary IP.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    DeleteProtection bool
    Whether delete protection is enabled.
    Id int
    ID of the Primary IP.
    IpAddress string
    IP address of the Primary IP.
    IpNetwork string
    IP network of the Primary IP for IPv6 addresses. Only set if type is ipv6.
    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 (ipv4 or ipv6).
    AssigneeId int
    ID of the resource the Primary IP is assigned to.
    AssigneeType string
    Type of the resource the Primary IP is assigned to.
    AutoDelete bool
    Whether auto delete is enabled.
    Datacenter string
    Name of the Datacenter of the Primary IP.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    DeleteProtection bool
    Whether delete protection is enabled.
    Id int
    ID of the Primary IP.
    IpAddress string
    IP address of the Primary IP.
    IpNetwork string
    IP network of the Primary IP for IPv6 addresses. Only set if type is ipv6.
    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 (ipv4 or ipv6).
    assigneeId Integer
    ID of the resource the Primary IP is assigned to.
    assigneeType String
    Type of the resource the Primary IP is assigned to.
    autoDelete Boolean
    Whether auto delete is enabled.
    datacenter String
    Name of the Datacenter of the Primary IP.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    deleteProtection Boolean
    Whether delete protection is enabled.
    id Integer
    ID of the Primary IP.
    ipAddress String
    IP address of the Primary IP.
    ipNetwork String
    IP network of the Primary IP for IPv6 addresses. Only set if type is ipv6.
    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 (ipv4 or ipv6).
    assigneeId number
    ID of the resource the Primary IP is assigned to.
    assigneeType string
    Type of the resource the Primary IP is assigned to.
    autoDelete boolean
    Whether auto delete is enabled.
    datacenter string
    Name of the Datacenter of the Primary IP.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    deleteProtection boolean
    Whether delete protection is enabled.
    id number
    ID of the Primary IP.
    ipAddress string
    IP address of the Primary IP.
    ipNetwork string
    IP network of the Primary IP for IPv6 addresses. Only set if type is ipv6.
    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 (ipv4 or ipv6).
    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.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    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 type is ipv6.
    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 (ipv4 or ipv6).
    assigneeId Number
    ID of the resource the Primary IP is assigned to.
    assigneeType String
    Type of the resource the Primary IP is assigned to.
    autoDelete Boolean
    Whether auto delete is enabled.
    datacenter String
    Name of the Datacenter of the Primary IP.

    Deprecated: The datacenter attribute is deprecated and will be removed after 1 July 2026. Please use the location attribute instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.

    deleteProtection Boolean
    Whether delete protection is enabled.
    id Number
    ID of the Primary IP.
    ipAddress String
    IP address of the Primary IP.
    ipNetwork String
    IP network of the Primary IP for IPv6 addresses. Only set if type is ipv6.
    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 (ipv4 or ipv6).

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Viewing docs for Hetzner Cloud v1.34.0
    published on Wednesday, Apr 29, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.