@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
173 lines • 6.12 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Adds a target to a Hetzner Cloud Load Balancer.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const myServer = new hcloud.Server("my_server", {
* name: "my-server",
* serverType: "cx23",
* image: "ubuntu-24.04",
* });
* const loadBalancer = new hcloud.LoadBalancer("load_balancer", {
* name: "my-load-balancer",
* loadBalancerType: "lb11",
* location: "nbg1",
* });
* const loadBalancerTarget = new hcloud.LoadBalancerTarget("load_balancer_target", {
* type: "server",
* loadBalancerId: loadBalancer.id.apply(x =>Number(x)),
* serverId: myServer.id.apply(x =>Number(x)),
* });
* ```
*
* ## Import
*
* Load Balancer Target entries can be imported using a compound ID with the following format:
* `<load-balancer-id>__<type>__<identifier>`
*
* Where _identifier_ depends on the _type_:
*
* - `server`: server id, for example: `123`
* - `labelSelector`: label selector, for example: `foo=bar`
* - `ip`: ip address, for example: `203.0.113.123`
*
* ```sh
* $ pulumi import hcloud:index/loadBalancerTarget:LoadBalancerTarget server "${LOAD_BALANCER_ID}__server__${SERVER_ID}"
* $ pulumi import hcloud:index/loadBalancerTarget:LoadBalancerTarget label "${LOAD_BALANCER_ID}__label_selector__${LABEL_SELECTOR}"
* $ pulumi import hcloud:index/loadBalancerTarget:LoadBalancerTarget ip "${LOAD_BALANCER_ID}__ip__${IP}"
* ```
*/
export declare class LoadBalancerTarget extends pulumi.CustomResource {
/**
* Get an existing LoadBalancerTarget 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<pulumi.ID>, state?: LoadBalancerTargetState, opts?: pulumi.CustomResourceOptions): LoadBalancerTarget;
/**
* Returns true if the given object is an instance of LoadBalancerTarget. 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 LoadBalancerTarget;
/**
* IP address for an IP Target. Required if
* `type` is `ip`.
*/
readonly ip: pulumi.Output<string | undefined>;
/**
* Label Selector selecting targets
* for this Load Balancer. Required if `type` is `labelSelector`.
*/
readonly labelSelector: pulumi.Output<string | undefined>;
/**
* ID of the Load Balancer to which
* the target gets attached.
*/
readonly loadBalancerId: pulumi.Output<number>;
/**
* ID of the server which should be a
* target for this Load Balancer. Required if `type` is `server`
*/
readonly serverId: pulumi.Output<number | undefined>;
/**
* Type of the target. Possible values
* `server`, `labelSelector`, `ip`.
*/
readonly type: pulumi.Output<string>;
/**
* use the private IP to connect to
* Load Balancer targets. Only allowed if type is `server` or
* `labelSelector`.
*/
readonly usePrivateIp: pulumi.Output<boolean>;
/**
* Create a LoadBalancerTarget 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: LoadBalancerTargetArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering LoadBalancerTarget resources.
*/
export interface LoadBalancerTargetState {
/**
* IP address for an IP Target. Required if
* `type` is `ip`.
*/
ip?: pulumi.Input<string | undefined>;
/**
* Label Selector selecting targets
* for this Load Balancer. Required if `type` is `labelSelector`.
*/
labelSelector?: pulumi.Input<string | undefined>;
/**
* ID of the Load Balancer to which
* the target gets attached.
*/
loadBalancerId?: pulumi.Input<number | undefined>;
/**
* ID of the server which should be a
* target for this Load Balancer. Required if `type` is `server`
*/
serverId?: pulumi.Input<number | undefined>;
/**
* Type of the target. Possible values
* `server`, `labelSelector`, `ip`.
*/
type?: pulumi.Input<string | undefined>;
/**
* use the private IP to connect to
* Load Balancer targets. Only allowed if type is `server` or
* `labelSelector`.
*/
usePrivateIp?: pulumi.Input<boolean | undefined>;
}
/**
* The set of arguments for constructing a LoadBalancerTarget resource.
*/
export interface LoadBalancerTargetArgs {
/**
* IP address for an IP Target. Required if
* `type` is `ip`.
*/
ip?: pulumi.Input<string | undefined>;
/**
* Label Selector selecting targets
* for this Load Balancer. Required if `type` is `labelSelector`.
*/
labelSelector?: pulumi.Input<string | undefined>;
/**
* ID of the Load Balancer to which
* the target gets attached.
*/
loadBalancerId: pulumi.Input<number>;
/**
* ID of the server which should be a
* target for this Load Balancer. Required if `type` is `server`
*/
serverId?: pulumi.Input<number | undefined>;
/**
* Type of the target. Possible values
* `server`, `labelSelector`, `ip`.
*/
type: pulumi.Input<string>;
/**
* use the private IP to connect to
* Load Balancer targets. Only allowed if type is `server` or
* `labelSelector`.
*/
usePrivateIp?: pulumi.Input<boolean | undefined>;
}
//# sourceMappingURL=loadBalancerTarget.d.ts.map