UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

139 lines 5.39 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.L7RuleV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 L7 Rule resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const network1 = new openstack.networking.Network("network_1", { * name: "network_1", * adminStateUp: true, * }); * const subnet1 = new openstack.networking.Subnet("subnet_1", { * name: "subnet_1", * cidr: "192.168.199.0/24", * ipVersion: 4, * networkId: network1.id, * }); * const loadbalancer1 = new openstack.loadbalancer.LoadBalancer("loadbalancer_1", { * name: "loadbalancer_1", * vipSubnetId: subnet1.id, * }); * const listener1 = new openstack.loadbalancer.Listener("listener_1", { * name: "listener_1", * protocol: "HTTP", * protocolPort: 8080, * loadbalancerId: loadbalancer1.id, * }); * const pool1 = new openstack.loadbalancer.Pool("pool_1", { * name: "pool_1", * protocol: "HTTP", * lbMethod: "ROUND_ROBIN", * loadbalancerId: loadbalancer1.id, * }); * const l7policy1 = new openstack.loadbalancer.L7PolicyV2("l7policy_1", { * name: "test", * action: "REDIRECT_TO_URL", * description: "test description", * position: 1, * listenerId: listener1.id, * redirectUrl: "http://www.example.com", * }); * const l7rule1 = new openstack.loadbalancer.L7RuleV2("l7rule_1", { * l7policyId: l7policy1.id, * type: "PATH", * compareType: "EQUAL_TO", * value: "/api", * }); * ``` * * ## Import * * Load Balancer L7 Rule can be imported using the L7 Policy ID and L7 Rule ID * separated by a slash, e.g.: * * ```sh * $ pulumi import openstack:loadbalancer/l7RuleV2:L7RuleV2 l7rule_1 e0bd694a-abbe-450e-b329-0931fd1cc5eb/4086b0c9-b18c-4d1c-b6b8-4c56c3ad2a9e * ``` */ class L7RuleV2 extends pulumi.CustomResource { /** * Get an existing L7RuleV2 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 L7RuleV2(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of L7RuleV2. 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'] === L7RuleV2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminStateUp"] = state?.adminStateUp; resourceInputs["compareType"] = state?.compareType; resourceInputs["invert"] = state?.invert; resourceInputs["key"] = state?.key; resourceInputs["l7policyId"] = state?.l7policyId; resourceInputs["listenerId"] = state?.listenerId; resourceInputs["region"] = state?.region; resourceInputs["tenantId"] = state?.tenantId; resourceInputs["type"] = state?.type; resourceInputs["value"] = state?.value; } else { const args = argsOrState; if (args?.compareType === undefined && !opts.urn) { throw new Error("Missing required property 'compareType'"); } if (args?.l7policyId === undefined && !opts.urn) { throw new Error("Missing required property 'l7policyId'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } if (args?.value === undefined && !opts.urn) { throw new Error("Missing required property 'value'"); } resourceInputs["adminStateUp"] = args?.adminStateUp; resourceInputs["compareType"] = args?.compareType; resourceInputs["invert"] = args?.invert; resourceInputs["key"] = args?.key; resourceInputs["l7policyId"] = args?.l7policyId; resourceInputs["region"] = args?.region; resourceInputs["tenantId"] = args?.tenantId; resourceInputs["type"] = args?.type; resourceInputs["value"] = args?.value; resourceInputs["listenerId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(L7RuleV2.__pulumiType, name, resourceInputs, opts); } } exports.L7RuleV2 = L7RuleV2; /** @internal */ L7RuleV2.__pulumiType = 'openstack:loadbalancer/l7RuleV2:L7RuleV2'; //# sourceMappingURL=l7ruleV2.js.map