UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

185 lines • 9.57 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.Listener = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 listener resource within OpenStack. * * > **Note:** This resource has attributes that depend on octavia minor versions. * Please ensure your Openstack cloud supports the required minor version. * * ## Example Usage * * ### Simple listener * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const listener1 = new openstack.loadbalancer.Listener("listener_1", { * protocol: "HTTP", * protocolPort: 8080, * loadbalancerId: "d9415786-5f1a-428b-b35f-2f1523e146d2", * insertHeaders: { * "X-Forwarded-For": "true", * }, * }); * ``` * * ### Listener with TLS and client certificate authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * import * as std from "@pulumi/std"; * * const certificate1 = new openstack.keymanager.SecretV1("certificate_1", { * name: "certificate", * payload: std.filebase64({ * input: "snakeoil.p12", * }).then(invoke => invoke.result), * payloadContentEncoding: "base64", * payloadContentType: "application/octet-stream", * }); * const caCertificate1 = new openstack.keymanager.SecretV1("ca_certificate_1", { * name: "certificate", * payload: std.file({ * input: "CA.pem", * }).then(invoke => invoke.result), * secretType: "certificate", * payloadContentType: "text/plain", * }); * const subnet1 = openstack.networking.getSubnet({ * name: "my-subnet", * }); * const lb1 = new openstack.loadbalancer.LoadBalancer("lb_1", { * name: "loadbalancer", * vipSubnetId: subnet1.then(subnet1 => subnet1.id), * }); * const listener1 = new openstack.loadbalancer.Listener("listener_1", { * name: "https", * protocol: "TERMINATED_HTTPS", * protocolPort: 443, * loadbalancerId: lb1.id, * defaultTlsContainerRef: certificate1, * clientAuthentication: "OPTIONAL", * clientCaTlsContainerRef: caCertificate2.secretRef, * }); * ``` * * ## Import * * Load Balancer Listener can be imported using the Listener ID, e.g.: * * ```sh * $ pulumi import openstack:loadbalancer/listener:Listener listener_1 b67ce64e-8b26-405d-afeb-4a078901f15a * ``` */ class Listener extends pulumi.CustomResource { /** * Get an existing Listener 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 Listener(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Listener. 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'] === Listener.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["allowedCidrs"] = state ? state.allowedCidrs : undefined; resourceInputs["alpnProtocols"] = state ? state.alpnProtocols : undefined; resourceInputs["clientAuthentication"] = state ? state.clientAuthentication : undefined; resourceInputs["clientCaTlsContainerRef"] = state ? state.clientCaTlsContainerRef : undefined; resourceInputs["clientCrlContainerRef"] = state ? state.clientCrlContainerRef : undefined; resourceInputs["connectionLimit"] = state ? state.connectionLimit : undefined; resourceInputs["defaultPoolId"] = state ? state.defaultPoolId : undefined; resourceInputs["defaultTlsContainerRef"] = state ? state.defaultTlsContainerRef : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["hstsIncludeSubdomains"] = state ? state.hstsIncludeSubdomains : undefined; resourceInputs["hstsMaxAge"] = state ? state.hstsMaxAge : undefined; resourceInputs["hstsPreload"] = state ? state.hstsPreload : undefined; resourceInputs["insertHeaders"] = state ? state.insertHeaders : undefined; resourceInputs["loadbalancerId"] = state ? state.loadbalancerId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["protocolPort"] = state ? state.protocolPort : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sniContainerRefs"] = state ? state.sniContainerRefs : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["timeoutClientData"] = state ? state.timeoutClientData : undefined; resourceInputs["timeoutMemberConnect"] = state ? state.timeoutMemberConnect : undefined; resourceInputs["timeoutMemberData"] = state ? state.timeoutMemberData : undefined; resourceInputs["timeoutTcpInspect"] = state ? state.timeoutTcpInspect : undefined; resourceInputs["tlsCiphers"] = state ? state.tlsCiphers : undefined; resourceInputs["tlsVersions"] = state ? state.tlsVersions : undefined; } else { const args = argsOrState; if ((!args || args.loadbalancerId === undefined) && !opts.urn) { throw new Error("Missing required property 'loadbalancerId'"); } if ((!args || args.protocol === undefined) && !opts.urn) { throw new Error("Missing required property 'protocol'"); } if ((!args || args.protocolPort === undefined) && !opts.urn) { throw new Error("Missing required property 'protocolPort'"); } resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["allowedCidrs"] = args ? args.allowedCidrs : undefined; resourceInputs["alpnProtocols"] = args ? args.alpnProtocols : undefined; resourceInputs["clientAuthentication"] = args ? args.clientAuthentication : undefined; resourceInputs["clientCaTlsContainerRef"] = args ? args.clientCaTlsContainerRef : undefined; resourceInputs["clientCrlContainerRef"] = args ? args.clientCrlContainerRef : undefined; resourceInputs["connectionLimit"] = args ? args.connectionLimit : undefined; resourceInputs["defaultPoolId"] = args ? args.defaultPoolId : undefined; resourceInputs["defaultTlsContainerRef"] = args ? args.defaultTlsContainerRef : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["hstsIncludeSubdomains"] = args ? args.hstsIncludeSubdomains : undefined; resourceInputs["hstsMaxAge"] = args ? args.hstsMaxAge : undefined; resourceInputs["hstsPreload"] = args ? args.hstsPreload : undefined; resourceInputs["insertHeaders"] = args ? args.insertHeaders : undefined; resourceInputs["loadbalancerId"] = args ? args.loadbalancerId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["protocolPort"] = args ? args.protocolPort : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sniContainerRefs"] = args ? args.sniContainerRefs : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["timeoutClientData"] = args ? args.timeoutClientData : undefined; resourceInputs["timeoutMemberConnect"] = args ? args.timeoutMemberConnect : undefined; resourceInputs["timeoutMemberData"] = args ? args.timeoutMemberData : undefined; resourceInputs["timeoutTcpInspect"] = args ? args.timeoutTcpInspect : undefined; resourceInputs["tlsCiphers"] = args ? args.tlsCiphers : undefined; resourceInputs["tlsVersions"] = args ? args.tlsVersions : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Listener.__pulumiType, name, resourceInputs, opts); } } exports.Listener = Listener; /** @internal */ Listener.__pulumiType = 'openstack:loadbalancer/listener:Listener'; //# sourceMappingURL=listener.js.map