"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetastoreService = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A managed metastore service that serves metadata queries.
 *
 * To get more information about Service, see:
 *
 * * [API documentation](https://cloud.google.com/dataproc-metastore/docs/reference/rest/v1/projects.locations.services)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dataproc-metastore/docs/overview)
 *
 * ## Example Usage
 *
 * ### Dataproc Metastore Service Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.dataproc.MetastoreService("default", {
 *     serviceId: "metastore-srv",
 *     location: "us-central1",
 *     port: 9080,
 *     tier: "DEVELOPER",
 *     maintenanceWindow: {
 *         hourOfDay: 2,
 *         dayOfWeek: "SUNDAY",
 *     },
 *     hiveMetastoreConfig: {
 *         version: "2.3.6",
 *     },
 *     labels: {
 *         env: "test",
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Deletion Protection
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.dataproc.MetastoreService("default", {
 *     serviceId: "metastore-srv",
 *     location: "us-central1",
 *     port: 9080,
 *     tier: "DEVELOPER",
 *     deletionProtection: true,
 *     maintenanceWindow: {
 *         hourOfDay: 2,
 *         dayOfWeek: "SUNDAY",
 *     },
 *     hiveMetastoreConfig: {
 *         version: "2.3.6",
 *     },
 *     labels: {
 *         env: "test",
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Cmek Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const keyRing = new gcp.kms.KeyRing("key_ring", {
 *     name: "example-keyring",
 *     location: "us-central1",
 * });
 * const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
 *     name: "example-key",
 *     keyRing: keyRing.id,
 *     purpose: "ENCRYPT_DECRYPT",
 * });
 * const _default = new gcp.dataproc.MetastoreService("default", {
 *     serviceId: "example-service",
 *     location: "us-central1",
 *     encryptionConfig: {
 *         kmsKey: cryptoKey.id,
 *     },
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Private Service Connect
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const net = new gcp.compute.Network("net", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const subnet = new gcp.compute.Subnetwork("subnet", {
 *     name: "my-subnetwork",
 *     region: "us-central1",
 *     network: net.id,
 *     ipCidrRange: "10.0.0.0/22",
 *     privateIpGoogleAccess: true,
 * });
 * const _default = new gcp.dataproc.MetastoreService("default", {
 *     serviceId: "metastore-srv",
 *     location: "us-central1",
 *     tier: "DEVELOPER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     networkConfig: {
 *         consumers: [{
 *             subnetwork: subnet.id,
 *         }],
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Private Service Connect Custom Routes
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const net = new gcp.compute.Network("net", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const subnet = new gcp.compute.Subnetwork("subnet", {
 *     name: "my-subnetwork",
 *     region: "us-central1",
 *     network: net.id,
 *     ipCidrRange: "10.0.0.0/22",
 *     privateIpGoogleAccess: true,
 * });
 * const _default = new gcp.dataproc.MetastoreService("default", {
 *     serviceId: "metastore-srv",
 *     location: "us-central1",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     networkConfig: {
 *         consumers: [{
 *             subnetwork: subnet.id,
 *         }],
 *         customRoutesEnabled: true,
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Dpms2
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const dpms2 = new gcp.dataproc.MetastoreService("dpms2", {
 *     serviceId: "ms-dpms2",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         instanceSize: "EXTRA_SMALL",
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Dpms2 Scaling Factor
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const dpms2ScalingFactor = new gcp.dataproc.MetastoreService("dpms2_scaling_factor", {
 *     serviceId: "ms-dpms2sf",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         scalingFactor: 2,
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Scheduled Backup
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "backup",
 *     location: "us-central1",
 * });
 * const backup = new gcp.dataproc.MetastoreService("backup", {
 *     serviceId: "backup",
 *     location: "us-central1",
 *     port: 9080,
 *     tier: "DEVELOPER",
 *     maintenanceWindow: {
 *         hourOfDay: 2,
 *         dayOfWeek: "SUNDAY",
 *     },
 *     hiveMetastoreConfig: {
 *         version: "2.3.6",
 *     },
 *     scheduledBackup: {
 *         enabled: true,
 *         cronSchedule: "0 0 * * *",
 *         timeZone: "UTC",
 *         backupLocation: pulumi.interpolate`gs://${bucket.name}`,
 *     },
 *     labels: {
 *         env: "test",
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Autoscaling Max Scaling Factor
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const testResource = new gcp.dataproc.MetastoreService("test_resource", {
 *     serviceId: "test-service",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         autoscalingConfig: {
 *             autoscalingEnabled: true,
 *             limitConfig: {
 *                 maxScalingFactor: 1,
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Autoscaling Min And Max Scaling Factor
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const testResource = new gcp.dataproc.MetastoreService("test_resource", {
 *     serviceId: "test-service",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         autoscalingConfig: {
 *             autoscalingEnabled: true,
 *             limitConfig: {
 *                 minScalingFactor: 0.1,
 *                 maxScalingFactor: 1,
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Autoscaling Min Scaling Factor
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const testResource = new gcp.dataproc.MetastoreService("test_resource", {
 *     serviceId: "test-service",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         autoscalingConfig: {
 *             autoscalingEnabled: true,
 *             limitConfig: {
 *                 minScalingFactor: 0.1,
 *             },
 *         },
 *     },
 * });
 * ```
 * ### Dataproc Metastore Service Autoscaling No Limit Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const testResource = new gcp.dataproc.MetastoreService("test_resource", {
 *     serviceId: "test-service",
 *     location: "us-central1",
 *     databaseType: "SPANNER",
 *     hiveMetastoreConfig: {
 *         version: "3.1.2",
 *     },
 *     scalingConfig: {
 *         autoscalingConfig: {
 *             autoscalingEnabled: true,
 *         },
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Service can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/services/{{service_id}}`
 *
 * * `{{project}}/{{location}}/{{service_id}}`
 *
 * * `{{location}}/{{service_id}}`
 *
 * When using the `pulumi import` command, Service can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataproc/metastoreService:MetastoreService default projects/{{project}}/locations/{{location}}/services/{{service_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataproc/metastoreService:MetastoreService default {{project}}/{{location}}/{{service_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataproc/metastoreService:MetastoreService default {{location}}/{{service_id}}
 * ```
 */
class MetastoreService extends pulumi.CustomResource {
    /**
     * Get an existing MetastoreService 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 MetastoreService(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of MetastoreService.  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'] === MetastoreService.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["artifactGcsUri"] = state?.artifactGcsUri;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["databaseType"] = state?.databaseType;
            resourceInputs["deletionProtection"] = state?.deletionProtection;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["encryptionConfig"] = state?.encryptionConfig;
            resourceInputs["endpointUri"] = state?.endpointUri;
            resourceInputs["hiveMetastoreConfig"] = state?.hiveMetastoreConfig;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["maintenanceWindow"] = state?.maintenanceWindow;
            resourceInputs["metadataIntegration"] = state?.metadataIntegration;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["networkConfig"] = state?.networkConfig;
            resourceInputs["port"] = state?.port;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["releaseChannel"] = state?.releaseChannel;
            resourceInputs["scalingConfig"] = state?.scalingConfig;
            resourceInputs["scheduledBackup"] = state?.scheduledBackup;
            resourceInputs["serviceId"] = state?.serviceId;
            resourceInputs["state"] = state?.state;
            resourceInputs["stateMessage"] = state?.stateMessage;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["telemetryConfig"] = state?.telemetryConfig;
            resourceInputs["tier"] = state?.tier;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            resourceInputs["databaseType"] = args?.databaseType;
            resourceInputs["deletionProtection"] = args?.deletionProtection;
            resourceInputs["encryptionConfig"] = args?.encryptionConfig;
            resourceInputs["hiveMetastoreConfig"] = args?.hiveMetastoreConfig;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["maintenanceWindow"] = args?.maintenanceWindow;
            resourceInputs["metadataIntegration"] = args?.metadataIntegration;
            resourceInputs["network"] = args?.network;
            resourceInputs["networkConfig"] = args?.networkConfig;
            resourceInputs["port"] = args?.port;
            resourceInputs["project"] = args?.project;
            resourceInputs["releaseChannel"] = args?.releaseChannel;
            resourceInputs["scalingConfig"] = args?.scalingConfig;
            resourceInputs["scheduledBackup"] = args?.scheduledBackup;
            resourceInputs["serviceId"] = args?.serviceId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["telemetryConfig"] = args?.telemetryConfig;
            resourceInputs["tier"] = args?.tier;
            resourceInputs["artifactGcsUri"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["endpointUri"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["stateMessage"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(MetastoreService.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MetastoreService = MetastoreService;
/** @internal */
MetastoreService.__pulumiType = 'gcp:dataproc/metastoreService:MetastoreService';
//# sourceMappingURL=metastoreService.js.map