UNPKG

@pulumi/hcloud

Version:

A Pulumi package for creating and managing hcloud cloud resources.

103 lines 4.21 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.LoadBalancerNetwork = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Hetzner Cloud Load Balancer Network to represent a private network on a Load Balancer in the Hetzner Cloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as hcloud from "@pulumi/hcloud"; * * const lb1 = new hcloud.LoadBalancer("lb1", { * name: "lb1", * loadBalancerType: "lb11", * networkZone: "eu-central", * }); * const mynet = new hcloud.Network("mynet", { * name: "my-net", * ipRange: "10.0.0.0/8", * }); * const foonet = new hcloud.NetworkSubnet("foonet", { * networkId: mynet.id, * type: "cloud", * networkZone: "eu-central", * ipRange: "10.0.1.0/24", * }); * const srvnetwork = new hcloud.LoadBalancerNetwork("srvnetwork", { * loadBalancerId: lb1.id, * networkId: mynet.id, * ip: "10.0.1.5", * }, { * dependsOn: [foonet], * }); * ``` * * ## Import * * Load Balancer Network entries can be imported using a compound ID with the following format: * * `<load-balancer-id>-<network-id>` * * ```sh * $ pulumi import hcloud:index/loadBalancerNetwork:LoadBalancerNetwork example "$LOAD_BALANCER_ID-$NETWORK_ID" * ``` */ class LoadBalancerNetwork extends pulumi.CustomResource { /** * Get an existing LoadBalancerNetwork 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, id, state, opts) { return new LoadBalancerNetwork(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of LoadBalancerNetwork. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === LoadBalancerNetwork.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["enablePublicInterface"] = state ? state.enablePublicInterface : undefined; resourceInputs["ip"] = state ? state.ip : undefined; resourceInputs["loadBalancerId"] = state ? state.loadBalancerId : undefined; resourceInputs["networkId"] = state ? state.networkId : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; } else { const args = argsOrState; if ((!args || args.loadBalancerId === undefined) && !opts.urn) { throw new Error("Missing required property 'loadBalancerId'"); } resourceInputs["enablePublicInterface"] = args ? args.enablePublicInterface : undefined; resourceInputs["ip"] = args ? args.ip : undefined; resourceInputs["loadBalancerId"] = args ? args.loadBalancerId : undefined; resourceInputs["networkId"] = args ? args.networkId : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LoadBalancerNetwork.__pulumiType, name, resourceInputs, opts); } } exports.LoadBalancerNetwork = LoadBalancerNetwork; /** @internal */ LoadBalancerNetwork.__pulumiType = 'hcloud:index/loadBalancerNetwork:LoadBalancerNetwork'; //# sourceMappingURL=loadBalancerNetwork.js.map