"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cluster = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Opensearch Cluster resource in Oracle Cloud Infrastructure Opensearch service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/opensearch/latest/OpensearchCluster
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/opensearch
 *
 * Creates a new OpensearchCluster.
 *
 * ## Prerequisites
 *
 * The below policies must be created in compartment before creating OpensearchCluster
 *
 * ##### {Compartment-Name} - Name of  your compartment
 *
 * For latest documentation on OpenSearch use please refer to https://docs.oracle.com/en-us/iaas/Content/search-opensearch/home.htm\
 * Required permissions: https://docs.oracle.com/en-us/iaas/Content/search-opensearch/Concepts/ocisearchpermissions.htm
 *
 * ## Import
 *
 * OpensearchClusters can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Opensearch/cluster:Cluster test_opensearch_cluster "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, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Opensearch/cluster:Cluster';
    /**
     * 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["availabilityDomains"] = state?.availabilityDomains;
            resourceInputs["certificateConfig"] = state?.certificateConfig;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["configureOutboundClusterTrigger"] = state?.configureOutboundClusterTrigger;
            resourceInputs["dataNodeCount"] = state?.dataNodeCount;
            resourceInputs["dataNodeHostBareMetalShape"] = state?.dataNodeHostBareMetalShape;
            resourceInputs["dataNodeHostMemoryGb"] = state?.dataNodeHostMemoryGb;
            resourceInputs["dataNodeHostOcpuCount"] = state?.dataNodeHostOcpuCount;
            resourceInputs["dataNodeHostShape"] = state?.dataNodeHostShape;
            resourceInputs["dataNodeHostType"] = state?.dataNodeHostType;
            resourceInputs["dataNodeStorageGb"] = state?.dataNodeStorageGb;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["fqdn"] = state?.fqdn;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["inboundClusterIds"] = state?.inboundClusterIds;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["loadBalancerConfig"] = state?.loadBalancerConfig;
            resourceInputs["maintenanceDetails"] = state?.maintenanceDetails;
            resourceInputs["masterNodeCount"] = state?.masterNodeCount;
            resourceInputs["masterNodeHostBareMetalShape"] = state?.masterNodeHostBareMetalShape;
            resourceInputs["masterNodeHostMemoryGb"] = state?.masterNodeHostMemoryGb;
            resourceInputs["masterNodeHostOcpuCount"] = state?.masterNodeHostOcpuCount;
            resourceInputs["masterNodeHostShape"] = state?.masterNodeHostShape;
            resourceInputs["masterNodeHostType"] = state?.masterNodeHostType;
            resourceInputs["mlNodeCount"] = state?.mlNodeCount;
            resourceInputs["mlNodeHostMemoryGb"] = state?.mlNodeHostMemoryGb;
            resourceInputs["mlNodeHostOcpuCount"] = state?.mlNodeHostOcpuCount;
            resourceInputs["mlNodeHostShape"] = state?.mlNodeHostShape;
            resourceInputs["mlNodeHostType"] = state?.mlNodeHostType;
            resourceInputs["mlNodeStorageGb"] = state?.mlNodeStorageGb;
            resourceInputs["nsgId"] = state?.nsgId;
            resourceInputs["opendashboardFqdn"] = state?.opendashboardFqdn;
            resourceInputs["opendashboardNodeCount"] = state?.opendashboardNodeCount;
            resourceInputs["opendashboardNodeHostMemoryGb"] = state?.opendashboardNodeHostMemoryGb;
            resourceInputs["opendashboardNodeHostOcpuCount"] = state?.opendashboardNodeHostOcpuCount;
            resourceInputs["opendashboardNodeHostShape"] = state?.opendashboardNodeHostShape;
            resourceInputs["opendashboardPrivateIp"] = state?.opendashboardPrivateIp;
            resourceInputs["opensearchFqdn"] = state?.opensearchFqdn;
            resourceInputs["opensearchPrivateIp"] = state?.opensearchPrivateIp;
            resourceInputs["outboundClusterConfig"] = state?.outboundClusterConfig;
            resourceInputs["reverseConnectionEndpointCustomerIps"] = state?.reverseConnectionEndpointCustomerIps;
            resourceInputs["reverseConnectionEndpoints"] = state?.reverseConnectionEndpoints;
            resourceInputs["searchNodeCount"] = state?.searchNodeCount;
            resourceInputs["searchNodeHostMemoryGb"] = state?.searchNodeHostMemoryGb;
            resourceInputs["searchNodeHostOcpuCount"] = state?.searchNodeHostOcpuCount;
            resourceInputs["searchNodeHostShape"] = state?.searchNodeHostShape;
            resourceInputs["searchNodeHostType"] = state?.searchNodeHostType;
            resourceInputs["searchNodeStorageGb"] = state?.searchNodeStorageGb;
            resourceInputs["securityAttributes"] = state?.securityAttributes;
            resourceInputs["securityMasterUserName"] = state?.securityMasterUserName;
            resourceInputs["securityMasterUserPasswordHash"] = state?.securityMasterUserPasswordHash;
            resourceInputs["securityMode"] = state?.securityMode;
            resourceInputs["securitySamlConfig"] = state?.securitySamlConfig;
            resourceInputs["softwareVersion"] = state?.softwareVersion;
            resourceInputs["state"] = state?.state;
            resourceInputs["subnetCompartmentId"] = state?.subnetCompartmentId;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeDeleted"] = state?.timeDeleted;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
            resourceInputs["totalStorageGb"] = state?.totalStorageGb;
            resourceInputs["upgradeMajorVersionTrigger"] = state?.upgradeMajorVersionTrigger;
            resourceInputs["vcnCompartmentId"] = state?.vcnCompartmentId;
            resourceInputs["vcnId"] = state?.vcnId;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.dataNodeCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataNodeCount'");
            }
            if (args?.dataNodeHostMemoryGb === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataNodeHostMemoryGb'");
            }
            if (args?.dataNodeHostOcpuCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataNodeHostOcpuCount'");
            }
            if (args?.dataNodeHostType === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataNodeHostType'");
            }
            if (args?.dataNodeStorageGb === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataNodeStorageGb'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.masterNodeCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'masterNodeCount'");
            }
            if (args?.masterNodeHostMemoryGb === undefined && !opts.urn) {
                throw new Error("Missing required property 'masterNodeHostMemoryGb'");
            }
            if (args?.masterNodeHostOcpuCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'masterNodeHostOcpuCount'");
            }
            if (args?.masterNodeHostType === undefined && !opts.urn) {
                throw new Error("Missing required property 'masterNodeHostType'");
            }
            if (args?.opendashboardNodeCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'opendashboardNodeCount'");
            }
            if (args?.opendashboardNodeHostMemoryGb === undefined && !opts.urn) {
                throw new Error("Missing required property 'opendashboardNodeHostMemoryGb'");
            }
            if (args?.opendashboardNodeHostOcpuCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'opendashboardNodeHostOcpuCount'");
            }
            if (args?.softwareVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'softwareVersion'");
            }
            if (args?.subnetCompartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetCompartmentId'");
            }
            if (args?.subnetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetId'");
            }
            if (args?.vcnCompartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'vcnCompartmentId'");
            }
            if (args?.vcnId === undefined && !opts.urn) {
                throw new Error("Missing required property 'vcnId'");
            }
            resourceInputs["certificateConfig"] = args?.certificateConfig;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["configureOutboundClusterTrigger"] = args?.configureOutboundClusterTrigger;
            resourceInputs["dataNodeCount"] = args?.dataNodeCount;
            resourceInputs["dataNodeHostBareMetalShape"] = args?.dataNodeHostBareMetalShape;
            resourceInputs["dataNodeHostMemoryGb"] = args?.dataNodeHostMemoryGb;
            resourceInputs["dataNodeHostOcpuCount"] = args?.dataNodeHostOcpuCount;
            resourceInputs["dataNodeHostShape"] = args?.dataNodeHostShape;
            resourceInputs["dataNodeHostType"] = args?.dataNodeHostType;
            resourceInputs["dataNodeStorageGb"] = args?.dataNodeStorageGb;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["inboundClusterIds"] = args?.inboundClusterIds;
            resourceInputs["loadBalancerConfig"] = args?.loadBalancerConfig;
            resourceInputs["maintenanceDetails"] = args?.maintenanceDetails;
            resourceInputs["masterNodeCount"] = args?.masterNodeCount;
            resourceInputs["masterNodeHostBareMetalShape"] = args?.masterNodeHostBareMetalShape;
            resourceInputs["masterNodeHostMemoryGb"] = args?.masterNodeHostMemoryGb;
            resourceInputs["masterNodeHostOcpuCount"] = args?.masterNodeHostOcpuCount;
            resourceInputs["masterNodeHostShape"] = args?.masterNodeHostShape;
            resourceInputs["masterNodeHostType"] = args?.masterNodeHostType;
            resourceInputs["mlNodeCount"] = args?.mlNodeCount;
            resourceInputs["mlNodeHostMemoryGb"] = args?.mlNodeHostMemoryGb;
            resourceInputs["mlNodeHostOcpuCount"] = args?.mlNodeHostOcpuCount;
            resourceInputs["mlNodeHostShape"] = args?.mlNodeHostShape;
            resourceInputs["mlNodeHostType"] = args?.mlNodeHostType;
            resourceInputs["mlNodeStorageGb"] = args?.mlNodeStorageGb;
            resourceInputs["nsgId"] = args?.nsgId;
            resourceInputs["opendashboardNodeCount"] = args?.opendashboardNodeCount;
            resourceInputs["opendashboardNodeHostMemoryGb"] = args?.opendashboardNodeHostMemoryGb;
            resourceInputs["opendashboardNodeHostOcpuCount"] = args?.opendashboardNodeHostOcpuCount;
            resourceInputs["opendashboardNodeHostShape"] = args?.opendashboardNodeHostShape;
            resourceInputs["outboundClusterConfig"] = args?.outboundClusterConfig;
            resourceInputs["reverseConnectionEndpointCustomerIps"] = args?.reverseConnectionEndpointCustomerIps;
            resourceInputs["searchNodeCount"] = args?.searchNodeCount;
            resourceInputs["searchNodeHostMemoryGb"] = args?.searchNodeHostMemoryGb;
            resourceInputs["searchNodeHostOcpuCount"] = args?.searchNodeHostOcpuCount;
            resourceInputs["searchNodeHostShape"] = args?.searchNodeHostShape;
            resourceInputs["searchNodeHostType"] = args?.searchNodeHostType;
            resourceInputs["searchNodeStorageGb"] = args?.searchNodeStorageGb;
            resourceInputs["securityAttributes"] = args?.securityAttributes;
            resourceInputs["securityMasterUserName"] = args?.securityMasterUserName;
            resourceInputs["securityMasterUserPasswordHash"] = args?.securityMasterUserPasswordHash ? pulumi.secret(args.securityMasterUserPasswordHash) : undefined;
            resourceInputs["securityMode"] = args?.securityMode;
            resourceInputs["securitySamlConfig"] = args?.securitySamlConfig ? pulumi.secret(args.securitySamlConfig) : undefined;
            resourceInputs["softwareVersion"] = args?.softwareVersion;
            resourceInputs["subnetCompartmentId"] = args?.subnetCompartmentId;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["systemTags"] = args?.systemTags;
            resourceInputs["upgradeMajorVersionTrigger"] = args?.upgradeMajorVersionTrigger;
            resourceInputs["vcnCompartmentId"] = args?.vcnCompartmentId;
            resourceInputs["vcnId"] = args?.vcnId;
            resourceInputs["availabilityDomains"] = undefined /*out*/;
            resourceInputs["fqdn"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["opendashboardFqdn"] = undefined /*out*/;
            resourceInputs["opendashboardPrivateIp"] = undefined /*out*/;
            resourceInputs["opensearchFqdn"] = undefined /*out*/;
            resourceInputs["opensearchPrivateIp"] = undefined /*out*/;
            resourceInputs["reverseConnectionEndpoints"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeDeleted"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
            resourceInputs["totalStorageGb"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["securityMasterUserPasswordHash", "securitySamlConfig"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Cluster.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Cluster = Cluster;
//# sourceMappingURL=cluster.js.map