@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
216 lines • 9.09 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Loadbalancer = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Creates and manages Scaleway Load Balancers.
*
* For more information, see the [main documentation](https://www.scaleway.com/en/docs/load-balancer/concepts/#load-balancers) or [API documentation](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-load-balancer-list-load-balancers).
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.loadbalancers.Ip("main", {zone: "fr-par-1"});
* const base = new scaleway.loadbalancers.LoadBalancer("base", {
* ipIds: [main.id],
* zone: main.zone,
* type: "LB-S",
* });
* ```
*
* ### Private LB
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const base = new scaleway.loadbalancers.LoadBalancer("base", {
* name: "private-lb",
* type: "LB-S",
* assignFlexibleIp: false,
* });
* ```
*
* ### With IPv6
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const v4 = new scaleway.loadbalancers.Ip("v4", {});
* const v6 = new scaleway.loadbalancers.Ip("v6", {isIpv6: true});
* const main = new scaleway.loadbalancers.LoadBalancer("main", {
* ipIds: [
* v4.id,
* v6.id,
* ],
* name: "ipv6-lb",
* type: "LB-S",
* });
* ```
*
* ### With IPAM IDs
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const vpc01 = new scaleway.network.Vpc("vpc01", {name: "my vpc"});
* const pn01 = new scaleway.network.PrivateNetwork("pn01", {
* vpcId: vpc01.id,
* ipv4Subnet: {
* subnet: "172.16.32.0/22",
* },
* });
* const ip01 = new scaleway.ipam.Ip("ip01", {
* address: "172.16.32.7",
* sources: [{
* privateNetworkId: pn01.id,
* }],
* });
* const v4 = new scaleway.loadbalancers.Ip("v4", {});
* const lb01 = new scaleway.loadbalancers.LoadBalancer("lb01", {
* ipIds: [v4.id],
* name: "my-lb",
* type: "LB-S",
* privateNetworks: [{
* privateNetworkId: pn01.id,
* ipamIds: ip01.id,
* }],
* });
* ```
*
* ## Migration
*
* In order to migrate to other Load Balancer types, you can check upwards or downwards migration via our CLI `scw lb lb-types list`.
* This change will not recreate your Load Balancer.
*
* Please check our [documentation](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-load-balancer-migrate-a-load-balancer) for further details.
*
* ## Import
*
* Load Balancers can be imported using `{zone}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:index/loadbalancer:Loadbalancer main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*
* Be aware that you will also need to import the `scaleway.loadbalancers.Ip` resource.
*
* @deprecated scaleway.index/loadbalancer.Loadbalancer has been deprecated in favor of scaleway.loadbalancers/loadbalancer.LoadBalancer
*/
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, id, state, opts) {
pulumi.log.warn("Loadbalancer is deprecated: scaleway.index/loadbalancer.Loadbalancer has been deprecated in favor of scaleway.loadbalancers/loadbalancer.LoadBalancer");
return new Loadbalancer(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:index/loadbalancer: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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Loadbalancer.__pulumiType;
}
/** @deprecated scaleway.index/loadbalancer.Loadbalancer has been deprecated in favor of scaleway.loadbalancers/loadbalancer.LoadBalancer */
constructor(name, argsOrState, opts) {
pulumi.log.warn("Loadbalancer is deprecated: scaleway.index/loadbalancer.Loadbalancer has been deprecated in favor of scaleway.loadbalancers/loadbalancer.LoadBalancer");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["assignFlexibleIp"] = state?.assignFlexibleIp;
resourceInputs["assignFlexibleIpv6"] = state?.assignFlexibleIpv6;
resourceInputs["description"] = state?.description;
resourceInputs["externalPrivateNetworks"] = state?.externalPrivateNetworks;
resourceInputs["ipAddress"] = state?.ipAddress;
resourceInputs["ipId"] = state?.ipId;
resourceInputs["ipIds"] = state?.ipIds;
resourceInputs["ipv6Address"] = state?.ipv6Address;
resourceInputs["name"] = state?.name;
resourceInputs["organizationId"] = state?.organizationId;
resourceInputs["privateIps"] = state?.privateIps;
resourceInputs["privateNetworks"] = state?.privateNetworks;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["releaseIp"] = state?.releaseIp;
resourceInputs["sslCompatibilityLevel"] = state?.sslCompatibilityLevel;
resourceInputs["tags"] = state?.tags;
resourceInputs["type"] = state?.type;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["assignFlexibleIp"] = args?.assignFlexibleIp;
resourceInputs["assignFlexibleIpv6"] = args?.assignFlexibleIpv6;
resourceInputs["description"] = args?.description;
resourceInputs["externalPrivateNetworks"] = args?.externalPrivateNetworks;
resourceInputs["ipId"] = args?.ipId;
resourceInputs["ipIds"] = args?.ipIds;
resourceInputs["name"] = args?.name;
resourceInputs["privateNetworks"] = args?.privateNetworks;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["releaseIp"] = args?.releaseIp;
resourceInputs["sslCompatibilityLevel"] = args?.sslCompatibilityLevel;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
resourceInputs["zone"] = args?.zone;
resourceInputs["ipAddress"] = undefined /*out*/;
resourceInputs["ipv6Address"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["privateIps"] = undefined /*out*/;
resourceInputs["region"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Loadbalancer.__pulumiType, name, resourceInputs, opts);
}
}
exports.Loadbalancer = Loadbalancer;
//# sourceMappingURL=loadbalancer.js.map