import * as pulumi from "@pulumi/pulumi"; /** * Provides details about a Hetzner Cloud Primary IP. * * This resource can be useful when you need to determine a Primary IP ID based on the IP address. * * Side note: * * 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. * * ## Deprecations * * ### `datacenter` attribute * * The `datacenter` attribute is deprecated, use the `location` attribute instead. * * See our the [API changelog](https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters) for more details. * * > Please upgrade to `v1.58.0+` of the provider to avoid issues once the Hetzner Cloud API no longer returns the `datacenter` attribute. * * ## Example Usage * * # Data Source: hcloud.PrimaryIp * * Provides details about a Hetzner Cloud Primary IP. * This resource can be useful when you need to determine a Primary IP ID based on the IP address. * * ### Additional Examples * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const ip1 = hcloud.getPrimaryIp({ * ipAddress: "1.2.3.4", * }); * const ip2 = hcloud.getPrimaryIp({ * name: "primary_ip_1", * }); * const ip3 = hcloud.getPrimaryIp({ * withSelector: "key=value", * }); * // Link a server to an existing primary IP * const serverTest = new hcloud.Server("server_test", { * name: "test-server", * image: "ubuntu-24.04", * serverType: "cx23", * location: "fsn1", * labels: { * test: "tessst1", * }, * publicNets: [{ * ipv4: ip1HcloudPrimaryIp.id, * }], * }); * ``` */ export declare function getPrimaryIp(args?: GetPrimaryIpArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getPrimaryIp. */ export interface GetPrimaryIpArgs { /** * ID of the Primary IP. */ id?: number; /** * IP address of the Primary IP. */ ipAddress?: string; /** * Name of the Primary IP. */ name?: string; /** * [Label selector](https://docs.hetzner.cloud/reference/cloud#label-selector) */ withSelector?: string; } /** * A collection of values returned by getPrimaryIp. */ export interface GetPrimaryIpResult { /** * (int) ID of the assigned resource. */ readonly assigneeId: number; /** * (string) The type of the assigned resource. */ readonly assigneeType: string; /** * (bool) Whether auto delete is enabled. */ readonly autoDelete: boolean; /** * (string, deprecated) The datacenter name of the Primary IP. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters. * * @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. */ readonly datacenter: string; /** * (bool) Whether delete protection is enabled. */ readonly deleteProtection: boolean; /** * (int) Unique ID of the Primary IP. */ readonly id?: number; /** * (string) IP Address of the Primary IP. */ readonly ipAddress?: string; /** * (string) IPv6 subnet of the Primary IP for IPv6 addresses. (Only set if `type` is `ipv6`) */ readonly ipNetwork: string; /** * (map) User-defined labels (key-value pairs). */ readonly labels: { [key: string]: string; }; /** * (string) The location of the Primary IP. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations. */ readonly location: string; /** * (string) Name of the Primary IP. */ readonly name?: string; /** * (string) Type of the Primary IP. */ readonly type: string; readonly withSelector?: string; } /** * Provides details about a Hetzner Cloud Primary IP. * * This resource can be useful when you need to determine a Primary IP ID based on the IP address. * * Side note: * * 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. * * ## Deprecations * * ### `datacenter` attribute * * The `datacenter` attribute is deprecated, use the `location` attribute instead. * * See our the [API changelog](https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters) for more details. * * > Please upgrade to `v1.58.0+` of the provider to avoid issues once the Hetzner Cloud API no longer returns the `datacenter` attribute. * * ## Example Usage * * # Data Source: hcloud.PrimaryIp * * Provides details about a Hetzner Cloud Primary IP. * This resource can be useful when you need to determine a Primary IP ID based on the IP address. * * ### Additional Examples * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const ip1 = hcloud.getPrimaryIp({ * ipAddress: "1.2.3.4", * }); * const ip2 = hcloud.getPrimaryIp({ * name: "primary_ip_1", * }); * const ip3 = hcloud.getPrimaryIp({ * withSelector: "key=value", * }); * // Link a server to an existing primary IP * const serverTest = new hcloud.Server("server_test", { * name: "test-server", * image: "ubuntu-24.04", * serverType: "cx23", * location: "fsn1", * labels: { * test: "tessst1", * }, * publicNets: [{ * ipv4: ip1HcloudPrimaryIp.id, * }], * }); * ``` */ export declare function getPrimaryIpOutput(args?: GetPrimaryIpOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getPrimaryIp. */ export interface GetPrimaryIpOutputArgs { /** * ID of the Primary IP. */ id?: pulumi.Input; /** * IP address of the Primary IP. */ ipAddress?: pulumi.Input; /** * Name of the Primary IP. */ name?: pulumi.Input; /** * [Label selector](https://docs.hetzner.cloud/reference/cloud#label-selector) */ withSelector?: pulumi.Input; }