import * as pulumi from "@pulumi/pulumi"; /** * Provides a Hetzner Cloud Primary IP resource. * * See the [Primary IP API documentation](https://docs.hetzner.cloud/reference/cloud#tag/primary-ips) for more details. * * ## 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 accepts * and returns the `datacenter` attribute. This version of the provider remains backward compatible by preserving * the `datacenter` value in the state and by extracting the `location` name from the `datacenter` attribute when * communicating with the API. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const main = new hcloud.PrimaryIp("main", { * name: "primary-ip", * location: "fsn1", * type: "ipv4", * autoDelete: false, * labels: { * key: "value", * }, * }); * // Link a server to a primary IP * const mainServer = new hcloud.Server("main", { * name: "server", * image: "ubuntu-24.04", * serverType: "cx23", * location: "fsn1", * publicNets: [{ * ipv4: main.id, * }], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * ```sh * $ pulumi import hcloud:index/primaryIp:PrimaryIp example "$PRIMARY_IP_ID" * ``` */ export declare class PrimaryIp extends pulumi.CustomResource { /** * Get an existing PrimaryIp resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: PrimaryIpState, opts?: pulumi.CustomResourceOptions): PrimaryIp; /** * Returns true if the given object is an instance of PrimaryIp. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PrimaryIp; /** * ID of the resource the Primary IP should be assigned to. */ readonly assigneeId: pulumi.Output; /** * Type of the resource the Primary IP should be assigned to. */ readonly assigneeType: pulumi.Output; /** * Whether auto delete is enabled. Setting `autoDelete` to `false` is recommended, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the terraform state. */ readonly autoDelete: pulumi.Output; /** * Name of the Datacenter for 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: pulumi.Output; /** * Whether delete protection is enabled. */ readonly deleteProtection: pulumi.Output; /** * IP address of the Primary IP. */ readonly ipAddress: pulumi.Output; /** * IP network of the Primary IP for IPv6 addresses. Only set if `type` is `ipv6`. */ readonly ipNetwork: pulumi.Output; /** * User-defined [labels](https://docs.hetzner.cloud/reference/cloud#labels) (key-value pairs) for the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; }>; /** * Name of the Location for 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: pulumi.Output; /** * Name of the Primary IP. */ readonly name: pulumi.Output; /** * Type of the Primary IP (`ipv4` or `ipv6`). */ readonly type: pulumi.Output; /** * Create a PrimaryIp resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: PrimaryIpArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PrimaryIp resources. */ export interface PrimaryIpState { /** * ID of the resource the Primary IP should be assigned to. */ assigneeId?: pulumi.Input; /** * Type of the resource the Primary IP should be assigned to. */ assigneeType?: pulumi.Input; /** * Whether auto delete is enabled. Setting `autoDelete` to `false` is recommended, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the terraform state. */ autoDelete?: pulumi.Input; /** * Name of the Datacenter for 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. */ datacenter?: pulumi.Input; /** * Whether delete protection is enabled. */ deleteProtection?: pulumi.Input; /** * IP address of the Primary IP. */ ipAddress?: pulumi.Input; /** * IP network of the Primary IP for IPv6 addresses. Only set if `type` is `ipv6`. */ ipNetwork?: pulumi.Input; /** * User-defined [labels](https://docs.hetzner.cloud/reference/cloud#labels) (key-value pairs) for the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Name of the Location for the Primary IP. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations. */ location?: pulumi.Input; /** * Name of the Primary IP. */ name?: pulumi.Input; /** * Type of the Primary IP (`ipv4` or `ipv6`). */ type?: pulumi.Input; } /** * The set of arguments for constructing a PrimaryIp resource. */ export interface PrimaryIpArgs { /** * ID of the resource the Primary IP should be assigned to. */ assigneeId?: pulumi.Input; /** * Type of the resource the Primary IP should be assigned to. */ assigneeType?: pulumi.Input; /** * Whether auto delete is enabled. Setting `autoDelete` to `false` is recommended, because if a server assigned to the managed ip is getting deleted, it will also delete the primary IP which will break the terraform state. */ autoDelete: pulumi.Input; /** * Name of the Datacenter for 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. */ datacenter?: pulumi.Input; /** * Whether delete protection is enabled. */ deleteProtection?: pulumi.Input; /** * User-defined [labels](https://docs.hetzner.cloud/reference/cloud#labels) (key-value pairs) for the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Name of the Location for the Primary IP. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations. */ location?: pulumi.Input; /** * Name of the Primary IP. */ name?: pulumi.Input; /** * Type of the Primary IP (`ipv4` or `ipv6`). */ type: pulumi.Input; }