"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");
/**
 * Provides a resource to manage listener
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooClb = new volcengine.clb.Clb("fooClb", {
 *     type: "public",
 *     subnetId: fooSubnet.id,
 *     loadBalancerSpec: "small_1",
 *     description: "acc0Demo",
 *     loadBalancerName: "acc-test-create",
 *     eipBillingConfig: {
 *         isp: "BGP",
 *         eipBillingType: "PostPaidByBandwidth",
 *         bandwidth: 1,
 *     },
 * });
 * const fooServerGroup = new volcengine.clb.ServerGroup("fooServerGroup", {
 *     loadBalancerId: fooClb.id,
 *     serverGroupName: "acc-test-create",
 *     description: "hello demo11",
 * });
 * const fooListener = new volcengine.clb.Listener("fooListener", {
 *     loadBalancerId: fooClb.id,
 *     listenerName: "acc-test-listener",
 *     protocol: "HTTP",
 *     port: 90,
 *     serverGroupId: fooServerGroup.id,
 *     healthCheck: {
 *         enabled: "on",
 *         interval: 10,
 *         timeout: 3,
 *         healthyThreshold: 5,
 *         unHealthyThreshold: 2,
 *         domain: "volcengine.com",
 *         httpCode: "http_2xx",
 *         method: "GET",
 *         uri: "/",
 *     },
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 *     enabled: "on",
 * });
 * const fooTcp = new volcengine.clb.Listener("fooTcp", {
 *     loadBalancerId: fooClb.id,
 *     listenerName: "acc-test-listener",
 *     protocol: "TCP",
 *     port: 90,
 *     serverGroupId: fooServerGroup.id,
 *     enabled: "on",
 *     bandwidth: 2,
 *     proxyProtocolType: "standard",
 *     persistenceType: "source_ip",
 *     persistenceTimeout: 100,
 *     connectionDrainEnabled: "on",
 *     connectionDrainTimeout: 100,
 * });
 * const fooHttps = new volcengine.clb.Listener("fooHttps", {
 *     loadBalancerId: fooClb.id,
 *     listenerName: "acc-test-listener-https",
 *     protocol: "HTTPS",
 *     port: 100,
 *     serverGroupId: fooServerGroup.id,
 *     healthCheck: {
 *         enabled: "on",
 *         interval: 10,
 *         timeout: 3,
 *         healthyThreshold: 5,
 *         unHealthyThreshold: 2,
 *         domain: "volcengine.com",
 *         httpCode: "http_2xx,http_3xx",
 *         method: "GET",
 *         uri: "/",
 *     },
 *     enabled: "on",
 *     clientHeaderTimeout: 80,
 *     clientBodyTimeout: 80,
 *     keepaliveTimeout: 80,
 *     proxyConnectTimeout: 20,
 *     proxySendTimeout: 1800,
 *     proxyReadTimeout: 1800,
 *     certificateSource: "clb",
 *     certificateId: "cert-mjpctunmog745smt1a******",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * Listener can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:clb/listener:Listener default lsn-273yv0mhs5xj47fap8sehiiso
 * ```
 */
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["aclIds"] = state ? state.aclIds : undefined;
            resourceInputs["aclStatus"] = state ? state.aclStatus : undefined;
            resourceInputs["aclType"] = state ? state.aclType : undefined;
            resourceInputs["bandwidth"] = state ? state.bandwidth : undefined;
            resourceInputs["caCertificateId"] = state ? state.caCertificateId : undefined;
            resourceInputs["caEnabled"] = state ? state.caEnabled : undefined;
            resourceInputs["certCenterCertificateId"] = state ? state.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = state ? state.certificateId : undefined;
            resourceInputs["certificateSource"] = state ? state.certificateSource : undefined;
            resourceInputs["clientBodyTimeout"] = state ? state.clientBodyTimeout : undefined;
            resourceInputs["clientHeaderTimeout"] = state ? state.clientHeaderTimeout : undefined;
            resourceInputs["connectionDrainEnabled"] = state ? state.connectionDrainEnabled : undefined;
            resourceInputs["connectionDrainTimeout"] = state ? state.connectionDrainTimeout : undefined;
            resourceInputs["cookie"] = state ? state.cookie : undefined;
            resourceInputs["cps"] = state ? state.cps : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["enabled"] = state ? state.enabled : undefined;
            resourceInputs["endPort"] = state ? state.endPort : undefined;
            resourceInputs["establishedTimeout"] = state ? state.establishedTimeout : undefined;
            resourceInputs["healthCheck"] = state ? state.healthCheck : undefined;
            resourceInputs["http2Enabled"] = state ? state.http2Enabled : undefined;
            resourceInputs["keepaliveTimeout"] = state ? state.keepaliveTimeout : undefined;
            resourceInputs["listenerId"] = state ? state.listenerId : undefined;
            resourceInputs["listenerName"] = state ? state.listenerName : undefined;
            resourceInputs["loadBalancerId"] = state ? state.loadBalancerId : undefined;
            resourceInputs["maxConnections"] = state ? state.maxConnections : undefined;
            resourceInputs["persistenceTimeout"] = state ? state.persistenceTimeout : undefined;
            resourceInputs["persistenceType"] = state ? state.persistenceType : undefined;
            resourceInputs["port"] = state ? state.port : undefined;
            resourceInputs["protocol"] = state ? state.protocol : undefined;
            resourceInputs["proxyConnectTimeout"] = state ? state.proxyConnectTimeout : undefined;
            resourceInputs["proxyProtocolType"] = state ? state.proxyProtocolType : undefined;
            resourceInputs["proxyReadTimeout"] = state ? state.proxyReadTimeout : undefined;
            resourceInputs["proxySendTimeout"] = state ? state.proxySendTimeout : undefined;
            resourceInputs["scheduler"] = state ? state.scheduler : undefined;
            resourceInputs["securityPolicyId"] = state ? state.securityPolicyId : undefined;
            resourceInputs["sendTimeout"] = state ? state.sendTimeout : undefined;
            resourceInputs["serverGroupId"] = state ? state.serverGroupId : undefined;
            resourceInputs["startPort"] = state ? state.startPort : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.loadBalancerId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'loadBalancerId'");
            }
            if ((!args || args.port === undefined) && !opts.urn) {
                throw new Error("Missing required property 'port'");
            }
            if ((!args || args.protocol === undefined) && !opts.urn) {
                throw new Error("Missing required property 'protocol'");
            }
            if ((!args || args.serverGroupId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'serverGroupId'");
            }
            resourceInputs["aclIds"] = args ? args.aclIds : undefined;
            resourceInputs["aclStatus"] = args ? args.aclStatus : undefined;
            resourceInputs["aclType"] = args ? args.aclType : undefined;
            resourceInputs["bandwidth"] = args ? args.bandwidth : undefined;
            resourceInputs["caCertificateId"] = args ? args.caCertificateId : undefined;
            resourceInputs["caEnabled"] = args ? args.caEnabled : undefined;
            resourceInputs["certCenterCertificateId"] = args ? args.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = args ? args.certificateId : undefined;
            resourceInputs["certificateSource"] = args ? args.certificateSource : undefined;
            resourceInputs["clientBodyTimeout"] = args ? args.clientBodyTimeout : undefined;
            resourceInputs["clientHeaderTimeout"] = args ? args.clientHeaderTimeout : undefined;
            resourceInputs["connectionDrainEnabled"] = args ? args.connectionDrainEnabled : undefined;
            resourceInputs["connectionDrainTimeout"] = args ? args.connectionDrainTimeout : undefined;
            resourceInputs["cookie"] = args ? args.cookie : undefined;
            resourceInputs["cps"] = args ? args.cps : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["enabled"] = args ? args.enabled : undefined;
            resourceInputs["endPort"] = args ? args.endPort : undefined;
            resourceInputs["establishedTimeout"] = args ? args.establishedTimeout : undefined;
            resourceInputs["healthCheck"] = args ? args.healthCheck : undefined;
            resourceInputs["http2Enabled"] = args ? args.http2Enabled : undefined;
            resourceInputs["keepaliveTimeout"] = args ? args.keepaliveTimeout : undefined;
            resourceInputs["listenerName"] = args ? args.listenerName : undefined;
            resourceInputs["loadBalancerId"] = args ? args.loadBalancerId : undefined;
            resourceInputs["maxConnections"] = args ? args.maxConnections : undefined;
            resourceInputs["persistenceTimeout"] = args ? args.persistenceTimeout : undefined;
            resourceInputs["persistenceType"] = args ? args.persistenceType : undefined;
            resourceInputs["port"] = args ? args.port : undefined;
            resourceInputs["protocol"] = args ? args.protocol : undefined;
            resourceInputs["proxyConnectTimeout"] = args ? args.proxyConnectTimeout : undefined;
            resourceInputs["proxyProtocolType"] = args ? args.proxyProtocolType : undefined;
            resourceInputs["proxyReadTimeout"] = args ? args.proxyReadTimeout : undefined;
            resourceInputs["proxySendTimeout"] = args ? args.proxySendTimeout : undefined;
            resourceInputs["scheduler"] = args ? args.scheduler : undefined;
            resourceInputs["securityPolicyId"] = args ? args.securityPolicyId : undefined;
            resourceInputs["sendTimeout"] = args ? args.sendTimeout : undefined;
            resourceInputs["serverGroupId"] = args ? args.serverGroupId : undefined;
            resourceInputs["startPort"] = args ? args.startPort : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["listenerId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Listener.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Listener = Listener;
/** @internal */
Listener.__pulumiType = 'volcengine:clb/listener:Listener';
//# sourceMappingURL=listener.js.map