"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.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage vke cluster
 * ## 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({});
 * // create vpc
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * // create subnet
 * 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,
 * });
 * // create security group
 * const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
 *     securityGroupName: "acc-test-security-group",
 *     vpcId: fooVpc.id,
 * });
 * // create vke cluster
 * const fooCluster = new volcengine.vke.Cluster("fooCluster", {
 *     description: "created by terraform",
 *     projectName: "default",
 *     deleteProtectionEnabled: false,
 *     irsaEnabled: false,
 *     clusterConfig: {
 *         subnetIds: [fooSubnet.id],
 *         apiServerPublicAccessEnabled: true,
 *         apiServerPublicAccessConfig: {
 *             publicAccessNetworkConfig: {
 *                 billingType: "PostPaidByBandwidth",
 *                 bandwidth: 1,
 *             },
 *         },
 *         resourcePublicAccessDefaultEnabled: true,
 *     },
 *     podsConfig: {
 *         podNetworkMode: "VpcCniShared",
 *         vpcCniConfig: {
 *             subnetIds: [fooSubnet.id],
 *         },
 *     },
 *     servicesConfig: {
 *         serviceCidrsv4s: ["172.30.0.0/18"],
 *     },
 *     loggingConfig: {
 *         logSetups: [
 *             {
 *                 logType: "ClusterAutoscaler",
 *                 enabled: true,
 *                 logTtl: 60,
 *             },
 *             {
 *                 logType: "Etcd",
 *                 enabled: false,
 *                 logTtl: 60,
 *             },
 *         ],
 *     },
 *     tags: [{
 *         key: "tf-k1",
 *         value: "tf-v1",
 *     }],
 * });
 * const fooImages = volcengine.ecs.getImages({
 *     nameRegex: "veLinux 1.0 CentOS Compatible 64 bit",
 * });
 * // create vke node pool
 * const fooNodePool = new volcengine.vke.NodePool("fooNodePool", {
 *     clusterId: fooCluster.id,
 *     management: {
 *         enabled: false,
 *     },
 *     autoScaling: {
 *         enabled: true,
 *         minReplicas: 0,
 *         maxReplicas: 5,
 *         desiredReplicas: 0,
 *         priority: 5,
 *         subnetPolicy: "ZoneBalance",
 *     },
 *     nodeConfig: {
 *         instanceTypeIds: ["ecs.g1ie.xlarge"],
 *         subnetIds: [fooSubnet.id],
 *         imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS Compatible 64 bit").map(image => (image.imageId))[0]),
 *         systemVolume: {
 *             type: "ESSD_PL0",
 *             size: 80,
 *         },
 *         dataVolumes: [
 *             {
 *                 type: "ESSD_PL0",
 *                 size: 80,
 *                 mountPoint: "/tf1",
 *             },
 *             {
 *                 type: "ESSD_PL0",
 *                 size: 60,
 *                 mountPoint: "/tf2",
 *             },
 *         ],
 *         initializeScript: "ZWNobyBoZWxsbyB0ZXJyYWZvcm0h",
 *         security: {
 *             login: {
 *                 password: "UHdkMTIzNDU2",
 *             },
 *             securityStrategies: ["Hids"],
 *             securityGroupIds: [fooSecurityGroup.id],
 *         },
 *         additionalContainerStorageEnabled: false,
 *         instanceChargeType: "PostPaid",
 *         namePrefix: "acc-test",
 *         projectName: "default",
 *         ecsTags: [{
 *             key: "ecs_k1",
 *             value: "ecs_v1",
 *         }],
 *     },
 *     kubernetesConfig: {
 *         labels: [{
 *             key: "label1",
 *             value: "value1",
 *         }],
 *         taints: [{
 *             key: "taint-key/node-type",
 *             value: "taint-value",
 *             effect: "NoSchedule",
 *         }],
 *         cordon: true,
 *         autoSyncDisabled: false,
 *     },
 *     tags: [{
 *         key: "node-pool-k1",
 *         value: "node-pool-v1",
 *     }],
 * });
 * // create ecs instance
 * const fooInstance = new volcengine.ecs.Instance("fooInstance", {
 *     instanceName: "acc-test-ecs",
 *     hostName: "tf-acc-test",
 *     imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS Compatible 64 bit").map(image => (image.imageId))[0]),
 *     instanceType: "ecs.g1ie.xlarge",
 *     password: "93f0cb0614Aab12",
 *     instanceChargeType: "PostPaid",
 *     systemVolumeType: "ESSD_PL0",
 *     systemVolumeSize: 50,
 *     subnetId: fooSubnet.id,
 *     securityGroupIds: [fooSecurityGroup.id],
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * // add the ecs instance to the vke node pool
 * const fooNode = new volcengine.vke.Node("fooNode", {
 *     clusterId: fooCluster.id,
 *     instanceId: fooInstance.id,
 *     nodePoolId: fooNodePool.id,
 * });
 * ```
 *
 * ## Import
 *
 * VkeCluster can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vke/cluster:Cluster default cc9l74mvqtofjnoj5****
 * ```
 */
class Cluster extends pulumi.CustomResource {
    /**
     * Get an existing Cluster 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 Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Cluster.  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'] === Cluster.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["clientToken"] = state ? state.clientToken : undefined;
            resourceInputs["clusterConfig"] = state ? state.clusterConfig : undefined;
            resourceInputs["deleteProtectionEnabled"] = state ? state.deleteProtectionEnabled : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["eipAllocationId"] = state ? state.eipAllocationId : undefined;
            resourceInputs["irsaConfigs"] = state ? state.irsaConfigs : undefined;
            resourceInputs["irsaEnabled"] = state ? state.irsaEnabled : undefined;
            resourceInputs["kubeconfigPrivate"] = state ? state.kubeconfigPrivate : undefined;
            resourceInputs["kubeconfigPublic"] = state ? state.kubeconfigPublic : undefined;
            resourceInputs["kubernetesVersion"] = state ? state.kubernetesVersion : undefined;
            resourceInputs["loggingConfig"] = state ? state.loggingConfig : undefined;
            resourceInputs["name"] = state ? state.name : undefined;
            resourceInputs["podsConfig"] = state ? state.podsConfig : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["servicesConfig"] = state ? state.servicesConfig : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.clusterConfig === undefined) && !opts.urn) {
                throw new Error("Missing required property 'clusterConfig'");
            }
            if ((!args || args.podsConfig === undefined) && !opts.urn) {
                throw new Error("Missing required property 'podsConfig'");
            }
            if ((!args || args.servicesConfig === undefined) && !opts.urn) {
                throw new Error("Missing required property 'servicesConfig'");
            }
            resourceInputs["clientToken"] = args ? args.clientToken : undefined;
            resourceInputs["clusterConfig"] = args ? args.clusterConfig : undefined;
            resourceInputs["deleteProtectionEnabled"] = args ? args.deleteProtectionEnabled : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["irsaEnabled"] = args ? args.irsaEnabled : undefined;
            resourceInputs["kubernetesVersion"] = args ? args.kubernetesVersion : undefined;
            resourceInputs["loggingConfig"] = args ? args.loggingConfig : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
            resourceInputs["podsConfig"] = args ? args.podsConfig : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["servicesConfig"] = args ? args.servicesConfig : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["eipAllocationId"] = undefined /*out*/;
            resourceInputs["irsaConfigs"] = undefined /*out*/;
            resourceInputs["kubeconfigPrivate"] = undefined /*out*/;
            resourceInputs["kubeconfigPublic"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Cluster.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'volcengine:vke/cluster:Cluster';
//# sourceMappingURL=cluster.js.map