UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

435 lines • 15.7 kB
"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.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, Object.assign(Object.assign({}, 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 ? state.artifactGcsUri : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["databaseType"] = state ? state.databaseType : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["encryptionConfig"] = state ? state.encryptionConfig : undefined; resourceInputs["endpointUri"] = state ? state.endpointUri : undefined; resourceInputs["hiveMetastoreConfig"] = state ? state.hiveMetastoreConfig : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["maintenanceWindow"] = state ? state.maintenanceWindow : undefined; resourceInputs["metadataIntegration"] = state ? state.metadataIntegration : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["networkConfig"] = state ? state.networkConfig : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["releaseChannel"] = state ? state.releaseChannel : undefined; resourceInputs["scalingConfig"] = state ? state.scalingConfig : undefined; resourceInputs["scheduledBackup"] = state ? state.scheduledBackup : undefined; resourceInputs["serviceId"] = state ? state.serviceId : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["stateMessage"] = state ? state.stateMessage : undefined; resourceInputs["telemetryConfig"] = state ? state.telemetryConfig : undefined; resourceInputs["tier"] = state ? state.tier : undefined; resourceInputs["uid"] = state ? state.uid : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; resourceInputs["databaseType"] = args ? args.databaseType : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["encryptionConfig"] = args ? args.encryptionConfig : undefined; resourceInputs["hiveMetastoreConfig"] = args ? args.hiveMetastoreConfig : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["maintenanceWindow"] = args ? args.maintenanceWindow : undefined; resourceInputs["metadataIntegration"] = args ? args.metadataIntegration : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["networkConfig"] = args ? args.networkConfig : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["releaseChannel"] = args ? args.releaseChannel : undefined; resourceInputs["scalingConfig"] = args ? args.scalingConfig : undefined; resourceInputs["scheduledBackup"] = args ? args.scheduledBackup : undefined; resourceInputs["serviceId"] = args ? args.serviceId : undefined; resourceInputs["telemetryConfig"] = args ? args.telemetryConfig : undefined; resourceInputs["tier"] = args ? args.tier : undefined; 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