"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 veecp 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({});
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-project1",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-subnet-test-2",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
 *     vpcId: fooVpc.id,
 *     securityGroupName: "acc-test-security-group2",
 * });
 * const fooCluster = new volcengine.veecp.Cluster("fooCluster", {
 *     description: "created by terraform",
 *     deleteProtectionEnabled: false,
 *     kubernetesVersion: "v1.24.15-veecp.1",
 *     profile: "Edge",
 *     clusterConfig: {
 *         subnetIds: [fooSubnet.id],
 *         apiServerPublicAccessEnabled: true,
 *         apiServerPublicAccessConfig: {
 *             publicAccessNetworkConfig: {
 *                 billingType: "PostPaidByBandwidth",
 *                 bandwidth: 1,
 *             },
 *         },
 *         resourcePublicAccessDefaultEnabled: true,
 *     },
 *     podsConfig: {
 *         podNetworkMode: "Flannel",
 *         flannelConfig: {
 *             podCidrs: ["172.22.224.0/20"],
 *             maxPodsPerNode: 64,
 *         },
 *     },
 *     servicesConfig: {
 *         serviceCidrsv4s: ["172.30.0.0/18"],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * VeecpCluster can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:veecp/cluster:Cluster default resource_id
 * ```
 */
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["edgeTunnelEnabled"] = state ? state.edgeTunnelEnabled : 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["profile"] = state ? state.profile : undefined;
            resourceInputs["servicesConfig"] = state ? state.servicesConfig : 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.profile === undefined) && !opts.urn) {
                throw new Error("Missing required property 'profile'");
            }
            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["edgeTunnelEnabled"] = args ? args.edgeTunnelEnabled : 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["profile"] = args ? args.profile : undefined;
            resourceInputs["servicesConfig"] = args ? args.servicesConfig : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Cluster.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'volcengine:veecp/cluster:Cluster';
//# sourceMappingURL=cluster.js.map