import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Create a load balancer in a public cloud project. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ovh from "@ovhcloud/pulumi-ovh"; * * const lb = new ovh.cloudproject.LoadBalancer("lb", { * serviceName: "", * regionName: "GRA9", * flavorId: "", * network: { * "private": { * network: { * id: .filter(region => region.region == "GRA9").map(region => (region))[0].openstackid, * subnetId: myprivsub.id, * }, * }, * }, * description: "My new LB", * listeners: [ * { * port: 34568, * protocol: "tcp", * }, * { * port: 34569, * protocol: "udp", * }, * ], * }); * ``` * * ### Example usage with network and subnet creation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ovh from "@ovhcloud/pulumi-ovh"; * * const priv = new ovh.cloudproject.NetworkPrivate("priv", { * serviceName: "", * vlanId: 10, * name: "my_priv", * regions: ["GRA9"], * }); * const privsub = new ovh.cloudproject.NetworkPrivateSubnet("privsub", { * serviceName: priv.serviceName, * networkId: priv.id, * region: "GRA9", * start: "10.0.0.2", * end: "10.0.255.254", * network: "10.0.0.0/16", * dhcp: true, * }); * const lb = new ovh.cloudproject.LoadBalancer("lb", { * serviceName: privsub.serviceName, * regionName: privsub.region, * flavorId: "", * network: { * "private": { * network: { * id: priv.regionsAttributes.apply(regionsAttributes => regionsAttributes.filter(region => region.region == "GRA9").map(region => (region)))[0].apply(regions => regions.openstackid), * subnetId: privsub.id, * }, * }, * }, * description: "My new LB", * listeners: [ * { * port: 34568, * protocol: "tcp", * }, * { * port: 34569, * protocol: "udp", * }, * ], * }); * ``` * * ## Import * * A load balancer in a public cloud project can be imported using the `service_name`, `region_name` and `id` attributes. Using the following configuration: * * terraform * * import { * * id = "//" * * to = ovh_cloud_project_loadbalancer.lb * * } * * You can then run: * * bash * * $ pulumi preview -generate-config-out=lb.tf * * $ pulumi up * * The file `lb.tf` will then contain the imported resource's configuration, that can be copied next to the `import` block above. See https://developer.hashicorp.com/terraform/language/import/generating-configuration for more details. */ export declare class LoadBalancer extends pulumi.CustomResource { /** * Get an existing LoadBalancer 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?: LoadBalancerState, opts?: pulumi.CustomResourceOptions): LoadBalancer; /** * Returns true if the given object is an instance of LoadBalancer. 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 LoadBalancer; /** * The UTC date and timestamp when the resource was created */ readonly createdAt: pulumi.Output; /** * Description of the loadbalancer */ readonly description: pulumi.Output; /** * Loadbalancer flavor id */ readonly flavorId: pulumi.Output; /** * Information about floating IP */ readonly floatingIp: pulumi.Output; /** * Listeners to create with the loadbalancer */ readonly listeners: pulumi.Output; /** * Name of the resource */ readonly name: pulumi.Output; /** * Network information to create the loadbalancer */ readonly network: pulumi.Output; /** * Operating status of the resource */ readonly operatingStatus: pulumi.Output; /** * Provisioning status of the resource */ readonly provisioningStatus: pulumi.Output; /** * Region of the resource */ readonly region: pulumi.Output; /** * Region name */ readonly regionName: pulumi.Output; /** * ID of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ readonly serviceName: pulumi.Output; /** * UTC date and timestamp when the resource was created */ readonly updatedAt: pulumi.Output; /** * IP address of the Virtual IP */ readonly vipAddress: pulumi.Output; /** * Openstack ID of the network for the Virtual IP */ readonly vipNetworkId: pulumi.Output; /** * ID of the subnet for the Virtual IP */ readonly vipSubnetId: pulumi.Output; /** * Create a LoadBalancer 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: LoadBalancerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering LoadBalancer resources. */ export interface LoadBalancerState { /** * The UTC date and timestamp when the resource was created */ createdAt?: pulumi.Input; /** * Description of the loadbalancer */ description?: pulumi.Input; /** * Loadbalancer flavor id */ flavorId?: pulumi.Input; /** * Information about floating IP */ floatingIp?: pulumi.Input; /** * Listeners to create with the loadbalancer */ listeners?: pulumi.Input[]>; /** * Name of the resource */ name?: pulumi.Input; /** * Network information to create the loadbalancer */ network?: pulumi.Input; /** * Operating status of the resource */ operatingStatus?: pulumi.Input; /** * Provisioning status of the resource */ provisioningStatus?: pulumi.Input; /** * Region of the resource */ region?: pulumi.Input; /** * Region name */ regionName?: pulumi.Input; /** * ID of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ serviceName?: pulumi.Input; /** * UTC date and timestamp when the resource was created */ updatedAt?: pulumi.Input; /** * IP address of the Virtual IP */ vipAddress?: pulumi.Input; /** * Openstack ID of the network for the Virtual IP */ vipNetworkId?: pulumi.Input; /** * ID of the subnet for the Virtual IP */ vipSubnetId?: pulumi.Input; } /** * The set of arguments for constructing a LoadBalancer resource. */ export interface LoadBalancerArgs { /** * Description of the loadbalancer */ description?: pulumi.Input; /** * Loadbalancer flavor id */ flavorId: pulumi.Input; /** * Listeners to create with the loadbalancer */ listeners?: pulumi.Input[]>; /** * Name of the resource */ name?: pulumi.Input; /** * Network information to create the loadbalancer */ network: pulumi.Input; /** * Region name */ regionName: pulumi.Input; /** * ID of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ serviceName?: pulumi.Input; }