"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 alb 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 fooAlb = new volcengine.alb.Alb("fooAlb", {
 *     addressIpVersion: "IPv4",
 *     type: "private",
 *     loadBalancerName: "acc-test-alb-private",
 *     description: "acc-test",
 *     subnetIds: [fooSubnet.id],
 *     projectName: "default",
 *     deleteProtection: "off",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * const fooServerGroup = new volcengine.alb.ServerGroup("fooServerGroup", {
 *     vpcId: fooVpc.id,
 *     serverGroupName: "acc-test-server-group",
 *     description: "acc-test",
 *     serverGroupType: "instance",
 *     scheduler: "wlc",
 *     projectName: "default",
 *     healthCheck: {
 *         enabled: "on",
 *         interval: 3,
 *         timeout: 3,
 *         method: "GET",
 *     },
 *     stickySessionConfig: {
 *         stickySessionEnabled: "on",
 *         stickySessionType: "insert",
 *         cookieTimeout: 1100,
 *     },
 * });
 * const fooCertificate = new volcengine.alb.Certificate("fooCertificate", {
 *     description: "tf-test",
 *     publicKey: "public key",
 *     privateKey: "private key",
 * });
 * const fooListener = new volcengine.alb.Listener("fooListener", {
 *     loadBalancerId: fooAlb.id,
 *     listenerName: "acc-test-listener",
 *     protocol: "HTTPS",
 *     port: 6666,
 *     enabled: "off",
 *     certificateSource: "alb",
 *     certificateId: fooCertificate.id,
 *     serverGroupId: fooServerGroup.id,
 *     description: "acc test listener",
 *     accessLogRecordCustomizedHeadersEnabled: "off",
 *     caCertificateSource: "alb",
 *     caCertificateId: "cert-xoekc6lpu9s054ov5eo*****",
 *     domainExtensions: [{
 *         domain: "example.com",
 *         certificateSource: "alb",
 *         certificateId: "cert-1pf4a8k8tokcg845wf******",
 *     }],
 *     tags: [{
 *         key: "key1",
 *         value: "value2",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * AlbListener can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:alb/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["accessLogRecordCustomizedHeadersEnabled"] = state ? state.accessLogRecordCustomizedHeadersEnabled : undefined;
            resourceInputs["aclIds"] = state ? state.aclIds : undefined;
            resourceInputs["aclStatus"] = state ? state.aclStatus : undefined;
            resourceInputs["aclType"] = state ? state.aclType : undefined;
            resourceInputs["caCertificateId"] = state ? state.caCertificateId : undefined;
            resourceInputs["caCertificateSource"] = state ? state.caCertificateSource : undefined;
            resourceInputs["certCenterCertificateId"] = state ? state.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = state ? state.certificateId : undefined;
            resourceInputs["certificateSource"] = state ? state.certificateSource : undefined;
            resourceInputs["customizedCfgId"] = state ? state.customizedCfgId : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["domainExtensions"] = state ? state.domainExtensions : undefined;
            resourceInputs["enableHttp2"] = state ? state.enableHttp2 : undefined;
            resourceInputs["enableQuic"] = state ? state.enableQuic : undefined;
            resourceInputs["enabled"] = state ? state.enabled : undefined;
            resourceInputs["listenerId"] = state ? state.listenerId : undefined;
            resourceInputs["listenerName"] = state ? state.listenerName : undefined;
            resourceInputs["loadBalancerId"] = state ? state.loadBalancerId : undefined;
            resourceInputs["pcaLeafCertificateId"] = state ? state.pcaLeafCertificateId : undefined;
            resourceInputs["pcaRootCaCertificateId"] = state ? state.pcaRootCaCertificateId : undefined;
            resourceInputs["pcaSubCaCertificateId"] = state ? state.pcaSubCaCertificateId : undefined;
            resourceInputs["port"] = state ? state.port : undefined;
            resourceInputs["protocol"] = state ? state.protocol : undefined;
            resourceInputs["serverGroupId"] = state ? state.serverGroupId : 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["accessLogRecordCustomizedHeadersEnabled"] = args ? args.accessLogRecordCustomizedHeadersEnabled : undefined;
            resourceInputs["aclIds"] = args ? args.aclIds : undefined;
            resourceInputs["aclStatus"] = args ? args.aclStatus : undefined;
            resourceInputs["aclType"] = args ? args.aclType : undefined;
            resourceInputs["caCertificateId"] = args ? args.caCertificateId : undefined;
            resourceInputs["caCertificateSource"] = args ? args.caCertificateSource : undefined;
            resourceInputs["certCenterCertificateId"] = args ? args.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = args ? args.certificateId : undefined;
            resourceInputs["certificateSource"] = args ? args.certificateSource : undefined;
            resourceInputs["customizedCfgId"] = args ? args.customizedCfgId : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["domainExtensions"] = args ? args.domainExtensions : undefined;
            resourceInputs["enableHttp2"] = args ? args.enableHttp2 : undefined;
            resourceInputs["enableQuic"] = args ? args.enableQuic : undefined;
            resourceInputs["enabled"] = args ? args.enabled : undefined;
            resourceInputs["listenerName"] = args ? args.listenerName : undefined;
            resourceInputs["loadBalancerId"] = args ? args.loadBalancerId : undefined;
            resourceInputs["pcaLeafCertificateId"] = args ? args.pcaLeafCertificateId : undefined;
            resourceInputs["pcaRootCaCertificateId"] = args ? args.pcaRootCaCertificateId : undefined;
            resourceInputs["pcaSubCaCertificateId"] = args ? args.pcaSubCaCertificateId : undefined;
            resourceInputs["port"] = args ? args.port : undefined;
            resourceInputs["protocol"] = args ? args.protocol : undefined;
            resourceInputs["serverGroupId"] = args ? args.serverGroupId : 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:alb/listener:Listener';
//# sourceMappingURL=listener.js.map