@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
137 lines • 5.37 kB
JavaScript
;
// *** 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.LoadbalancerRoute = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Creates and manages Scaleway Load-Balancer Routes.
* For more information, see [the documentation](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-route).
*
* ## Examples
*
* ### With SNI for direction to TCP backends
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const ip01 = new scaleway.LoadbalancerIp("ip01", {});
* const lb01 = new scaleway.Loadbalancer("lb01", {
* ipId: ip01.id,
* type: "lb-s",
* });
* const bkd01 = new scaleway.LoadbalancerBackend("bkd01", {
* lbId: lb01.id,
* forwardProtocol: "tcp",
* forwardPort: 80,
* proxyProtocol: "none",
* });
* const frt01 = new scaleway.LoadbalancerFrontend("frt01", {
* lbId: lb01.id,
* backendId: bkd01.id,
* inboundPort: 80,
* });
* const rt01 = new scaleway.LoadbalancerRoute("rt01", {
* frontendId: frt01.id,
* backendId: bkd01.id,
* matchSni: "sni.scaleway.com",
* });
* ```
*
* ### With host-header for direction to HTTP backends
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const ip01 = new scaleway.LoadbalancerIp("ip01", {});
* const lb01 = new scaleway.Loadbalancer("lb01", {
* ipId: ip01.id,
* type: "lb-s",
* });
* const bkd01 = new scaleway.LoadbalancerBackend("bkd01", {
* lbId: lb01.id,
* forwardProtocol: "http",
* forwardPort: 80,
* proxyProtocol: "none",
* });
* const frt01 = new scaleway.LoadbalancerFrontend("frt01", {
* lbId: lb01.id,
* backendId: bkd01.id,
* inboundPort: 80,
* });
* const rt01 = new scaleway.LoadbalancerRoute("rt01", {
* frontendId: frt01.id,
* backendId: bkd01.id,
* matchHostHeader: "host.scaleway.com",
* });
* ```
*
* ## Import
*
* Load-Balancer frontend can be imported using the `{zone}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/loadbalancerRoute:LoadbalancerRoute main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
class LoadbalancerRoute extends pulumi.CustomResource {
/**
* Get an existing LoadbalancerRoute 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 LoadbalancerRoute(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LoadbalancerRoute. 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'] === LoadbalancerRoute.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backendId"] = state ? state.backendId : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["frontendId"] = state ? state.frontendId : undefined;
resourceInputs["matchHostHeader"] = state ? state.matchHostHeader : undefined;
resourceInputs["matchSni"] = state ? state.matchSni : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.backendId === undefined) && !opts.urn) {
throw new Error("Missing required property 'backendId'");
}
if ((!args || args.frontendId === undefined) && !opts.urn) {
throw new Error("Missing required property 'frontendId'");
}
resourceInputs["backendId"] = args ? args.backendId : undefined;
resourceInputs["frontendId"] = args ? args.frontendId : undefined;
resourceInputs["matchHostHeader"] = args ? args.matchHostHeader : undefined;
resourceInputs["matchSni"] = args ? args.matchSni : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LoadbalancerRoute.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoadbalancerRoute = LoadbalancerRoute;
/** @internal */
LoadbalancerRoute.__pulumiType = 'scaleway:index/loadbalancerRoute:LoadbalancerRoute';
//# sourceMappingURL=loadbalancerRoute.js.map