UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

203 lines 8.32 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.LoadbalancerFrontend = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages Scaleway Load Balancer frontends. * * For more information, see the [main documentation](https://www.scaleway.com/en/docs/load-balancer/reference-content/configuring-frontends/) or [API documentation](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-frontends). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const frontend01 = new scaleway.loadbalancers.Frontend("frontend01", { * lbId: lb01.id, * backendId: backend01.id, * name: "frontend01", * inboundPort: 80, * }); * ``` * * ## With ACLs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const frontend01 = new scaleway.loadbalancers.Frontend("frontend01", { * lbId: lb01.id, * backendId: backend01.id, * name: "frontend01", * inboundPort: 80, * acls: [ * { * name: "blacklist wellknwon IPs", * action: { * type: "allow", * }, * match: { * ipSubnets: [ * "192.168.0.1", * "192.168.0.2", * "192.168.10.0/24", * ], * }, * }, * { * action: { * type: "deny", * }, * match: { * ipSubnets: ["51.51.51.51"], * httpFilter: "regex", * httpFilterValues: ["^foo*bar$"], * }, * }, * { * action: { * type: "allow", * }, * match: { * httpFilter: "path_begin", * httpFilterValues: [ * "foo", * "bar", * ], * }, * }, * { * action: { * type: "allow", * }, * match: { * httpFilter: "path_begin", * httpFilterValues: ["hi"], * invert: true, * }, * }, * { * action: { * type: "allow", * }, * match: { * httpFilter: "http_header_match", * httpFilterValues: "foo", * httpFilterOption: "bar", * }, * }, * { * action: { * type: "redirect", * redirects: [{ * type: "location", * target: "https://example.com", * code: 307, * }], * }, * match: { * ipSubnets: ["10.0.0.10"], * httpFilter: "path_begin", * httpFilterValues: [ * "foo", * "bar", * ], * }, * }, * ], * }); * ``` * * ## Import * * Load Balancer frontends can be imported using `{zone}/{id}`, e.g. * * bash * * ```sh * $ pulumi import scaleway:index/loadbalancerFrontend:LoadbalancerFrontend frontend01 fr-par-1/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/loadbalancerfrontend.LoadbalancerFrontend has been deprecated in favor of scaleway.loadbalancers/frontend.Frontend */ class LoadbalancerFrontend extends pulumi.CustomResource { /** * Get an existing LoadbalancerFrontend 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("LoadbalancerFrontend is deprecated: scaleway.index/loadbalancerfrontend.LoadbalancerFrontend has been deprecated in favor of scaleway.loadbalancers/frontend.Frontend"); return new LoadbalancerFrontend(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of LoadbalancerFrontend. 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'] === LoadbalancerFrontend.__pulumiType; } /** @deprecated scaleway.index/loadbalancerfrontend.LoadbalancerFrontend has been deprecated in favor of scaleway.loadbalancers/frontend.Frontend */ constructor(name, argsOrState, opts) { pulumi.log.warn("LoadbalancerFrontend is deprecated: scaleway.index/loadbalancerfrontend.LoadbalancerFrontend has been deprecated in favor of scaleway.loadbalancers/frontend.Frontend"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acls"] = state ? state.acls : undefined; resourceInputs["backendId"] = state ? state.backendId : undefined; resourceInputs["certificateId"] = state ? state.certificateId : undefined; resourceInputs["certificateIds"] = state ? state.certificateIds : undefined; resourceInputs["connectionRateLimit"] = state ? state.connectionRateLimit : undefined; resourceInputs["enableHttp3"] = state ? state.enableHttp3 : undefined; resourceInputs["externalAcls"] = state ? state.externalAcls : undefined; resourceInputs["inboundPort"] = state ? state.inboundPort : undefined; resourceInputs["lbId"] = state ? state.lbId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["timeoutClient"] = state ? state.timeoutClient : undefined; } else { const args = argsOrState; if ((!args || args.backendId === undefined) && !opts.urn) { throw new Error("Missing required property 'backendId'"); } if ((!args || args.inboundPort === undefined) && !opts.urn) { throw new Error("Missing required property 'inboundPort'"); } if ((!args || args.lbId === undefined) && !opts.urn) { throw new Error("Missing required property 'lbId'"); } resourceInputs["acls"] = args ? args.acls : undefined; resourceInputs["backendId"] = args ? args.backendId : undefined; resourceInputs["certificateIds"] = args ? args.certificateIds : undefined; resourceInputs["connectionRateLimit"] = args ? args.connectionRateLimit : undefined; resourceInputs["enableHttp3"] = args ? args.enableHttp3 : undefined; resourceInputs["externalAcls"] = args ? args.externalAcls : undefined; resourceInputs["inboundPort"] = args ? args.inboundPort : undefined; resourceInputs["lbId"] = args ? args.lbId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["timeoutClient"] = args ? args.timeoutClient : undefined; resourceInputs["certificateId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LoadbalancerFrontend.__pulumiType, name, resourceInputs, opts); } } exports.LoadbalancerFrontend = LoadbalancerFrontend; /** @internal */ LoadbalancerFrontend.__pulumiType = 'scaleway:index/loadbalancerFrontend:LoadbalancerFrontend'; //# sourceMappingURL=loadbalancerFrontend.js.map