UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

125 lines 6.53 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.Listener = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an ELB listener resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const listener1 = new huaweicloud.Elb.Listener("listener_1", { * loadbalancerId: "d9415786-5f1a-428b-b35f-2f1523e146d2", * protocol: "HTTP", * protocolPort: 8080, * tags: { * key: "value", * }, * }); * ``` * * ## Import * * ELB listener can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Elb/listener:Listener test <id> * ``` */ 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["clientCaTlsContainerRef"] = state ? state.clientCaTlsContainerRef : undefined; resourceInputs["connectionLimit"] = state ? state.connectionLimit : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["defaultPoolId"] = state ? state.defaultPoolId : undefined; resourceInputs["defaultTlsContainerRef"] = state ? state.defaultTlsContainerRef : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["http2Enable"] = state ? state.http2Enable : undefined; resourceInputs["insertHeaders"] = state ? state.insertHeaders : undefined; resourceInputs["loadbalancerId"] = state ? state.loadbalancerId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["protectionReason"] = state ? state.protectionReason : undefined; resourceInputs["protectionStatus"] = state ? state.protectionStatus : 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["tlsCiphersPolicy"] = state ? state.tlsCiphersPolicy : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : 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["clientCaTlsContainerRef"] = args ? args.clientCaTlsContainerRef : 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["http2Enable"] = args ? args.http2Enable : undefined; resourceInputs["insertHeaders"] = args ? args.insertHeaders : undefined; resourceInputs["loadbalancerId"] = args ? args.loadbalancerId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["protectionReason"] = args ? args.protectionReason : undefined; resourceInputs["protectionStatus"] = args ? args.protectionStatus : 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["tlsCiphersPolicy"] = args ? args.tlsCiphersPolicy : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Listener.__pulumiType, name, resourceInputs, opts); } } exports.Listener = Listener; /** @internal */ Listener.__pulumiType = 'huaweicloud:Elb/listener:Listener'; //# sourceMappingURL=listener.js.map