@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
759 lines (758 loc) • 26.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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}}
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: MetastoreServiceState, opts?: pulumi.CustomResourceOptions): MetastoreService;
/**
* 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: any): obj is MetastoreService;
/**
* A Cloud Storage URI (starting with gs://) that specifies where artifacts related to the metastore service are stored.
*/
readonly artifactGcsUri: pulumi.Output<string>;
/**
* Output only. The time when the metastore service was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* The database type that the Metastore service stores its data.
* Default value is `MYSQL`.
* Possible values are: `MYSQL`, `SPANNER`.
*/
readonly databaseType: pulumi.Output<string | undefined>;
/**
* Indicates if the dataproc metastore should be protected against accidental deletions.
*/
readonly deletionProtection: pulumi.Output<boolean | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Information used to configure the Dataproc Metastore service to encrypt
* customer data at rest.
* Structure is documented below.
*/
readonly encryptionConfig: pulumi.Output<outputs.dataproc.MetastoreServiceEncryptionConfig | undefined>;
/**
* The URI of the endpoint used to access the metastore service.
*/
readonly endpointUri: pulumi.Output<string>;
/**
* Configuration information specific to running Hive metastore software as the metastore service.
* Structure is documented below.
*/
readonly hiveMetastoreConfig: pulumi.Output<outputs.dataproc.MetastoreServiceHiveMetastoreConfig | undefined>;
/**
* User-defined labels for the metastore service.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The location where the metastore service should reside.
* The default value is `global`.
*/
readonly location: pulumi.Output<string | undefined>;
/**
* The one hour maintenance window of the metastore service.
* This specifies when the service can be restarted for maintenance purposes in UTC time.
* Maintenance window is not needed for services with the `SPANNER` database type.
* Structure is documented below.
*/
readonly maintenanceWindow: pulumi.Output<outputs.dataproc.MetastoreServiceMaintenanceWindow | undefined>;
/**
* The setting that defines how metastore metadata should be integrated with external services and systems.
* Structure is documented below.
*/
readonly metadataIntegration: pulumi.Output<outputs.dataproc.MetastoreServiceMetadataIntegration | undefined>;
/**
* The relative resource name of the metastore service.
*/
readonly name: pulumi.Output<string>;
/**
* The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:
* "projects/{projectNumber}/global/networks/{network_id}".
*/
readonly network: pulumi.Output<string>;
/**
* The configuration specifying the network settings for the Dataproc Metastore service.
* Structure is documented below.
*/
readonly networkConfig: pulumi.Output<outputs.dataproc.MetastoreServiceNetworkConfig | undefined>;
/**
* The TCP port at which the metastore service is reached. Default: 9083.
*/
readonly port: pulumi.Output<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The release channel of the service. If unspecified, defaults to `STABLE`.
* Default value is `STABLE`.
* Possible values are: `CANARY`, `STABLE`.
*/
readonly releaseChannel: pulumi.Output<string | undefined>;
/**
* Represents the scaling configuration of a metastore service.
* Structure is documented below.
*/
readonly scalingConfig: pulumi.Output<outputs.dataproc.MetastoreServiceScalingConfig | undefined>;
/**
* The configuration of scheduled backup for the metastore service.
* Structure is documented below.
*/
readonly scheduledBackup: pulumi.Output<outputs.dataproc.MetastoreServiceScheduledBackup | undefined>;
/**
* The ID of the metastore service. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
* and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between
* 3 and 63 characters.
*
*
* - - -
*/
readonly serviceId: pulumi.Output<string>;
/**
* The current state of the metastore service.
*/
readonly state: pulumi.Output<string>;
/**
* Additional information about the current state of the metastore service, if available.
*/
readonly stateMessage: pulumi.Output<string>;
/**
* The configuration specifying telemetry settings for the Dataproc Metastore service. If unspecified defaults to JSON.
* Structure is documented below.
*/
readonly telemetryConfig: pulumi.Output<outputs.dataproc.MetastoreServiceTelemetryConfig>;
/**
* The tier of the service.
* Possible values are: `DEVELOPER`, `ENTERPRISE`.
*/
readonly tier: pulumi.Output<string>;
/**
* The globally unique resource identifier of the metastore service.
*/
readonly uid: pulumi.Output<string>;
/**
* Output only. The time when the metastore service was last updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Create a MetastoreService resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: MetastoreServiceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering MetastoreService resources.
*/
export interface MetastoreServiceState {
/**
* A Cloud Storage URI (starting with gs://) that specifies where artifacts related to the metastore service are stored.
*/
artifactGcsUri?: pulumi.Input<string>;
/**
* Output only. The time when the metastore service was created.
*/
createTime?: pulumi.Input<string>;
/**
* The database type that the Metastore service stores its data.
* Default value is `MYSQL`.
* Possible values are: `MYSQL`, `SPANNER`.
*/
databaseType?: pulumi.Input<string>;
/**
* Indicates if the dataproc metastore should be protected against accidental deletions.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Information used to configure the Dataproc Metastore service to encrypt
* customer data at rest.
* Structure is documented below.
*/
encryptionConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceEncryptionConfig>;
/**
* The URI of the endpoint used to access the metastore service.
*/
endpointUri?: pulumi.Input<string>;
/**
* Configuration information specific to running Hive metastore software as the metastore service.
* Structure is documented below.
*/
hiveMetastoreConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceHiveMetastoreConfig>;
/**
* User-defined labels for the metastore service.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The location where the metastore service should reside.
* The default value is `global`.
*/
location?: pulumi.Input<string>;
/**
* The one hour maintenance window of the metastore service.
* This specifies when the service can be restarted for maintenance purposes in UTC time.
* Maintenance window is not needed for services with the `SPANNER` database type.
* Structure is documented below.
*/
maintenanceWindow?: pulumi.Input<inputs.dataproc.MetastoreServiceMaintenanceWindow>;
/**
* The setting that defines how metastore metadata should be integrated with external services and systems.
* Structure is documented below.
*/
metadataIntegration?: pulumi.Input<inputs.dataproc.MetastoreServiceMetadataIntegration>;
/**
* The relative resource name of the metastore service.
*/
name?: pulumi.Input<string>;
/**
* The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:
* "projects/{projectNumber}/global/networks/{network_id}".
*/
network?: pulumi.Input<string>;
/**
* The configuration specifying the network settings for the Dataproc Metastore service.
* Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceNetworkConfig>;
/**
* The TCP port at which the metastore service is reached. Default: 9083.
*/
port?: pulumi.Input<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The release channel of the service. If unspecified, defaults to `STABLE`.
* Default value is `STABLE`.
* Possible values are: `CANARY`, `STABLE`.
*/
releaseChannel?: pulumi.Input<string>;
/**
* Represents the scaling configuration of a metastore service.
* Structure is documented below.
*/
scalingConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceScalingConfig>;
/**
* The configuration of scheduled backup for the metastore service.
* Structure is documented below.
*/
scheduledBackup?: pulumi.Input<inputs.dataproc.MetastoreServiceScheduledBackup>;
/**
* The ID of the metastore service. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
* and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between
* 3 and 63 characters.
*
*
* - - -
*/
serviceId?: pulumi.Input<string>;
/**
* The current state of the metastore service.
*/
state?: pulumi.Input<string>;
/**
* Additional information about the current state of the metastore service, if available.
*/
stateMessage?: pulumi.Input<string>;
/**
* The configuration specifying telemetry settings for the Dataproc Metastore service. If unspecified defaults to JSON.
* Structure is documented below.
*/
telemetryConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceTelemetryConfig>;
/**
* The tier of the service.
* Possible values are: `DEVELOPER`, `ENTERPRISE`.
*/
tier?: pulumi.Input<string>;
/**
* The globally unique resource identifier of the metastore service.
*/
uid?: pulumi.Input<string>;
/**
* Output only. The time when the metastore service was last updated.
*/
updateTime?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a MetastoreService resource.
*/
export interface MetastoreServiceArgs {
/**
* The database type that the Metastore service stores its data.
* Default value is `MYSQL`.
* Possible values are: `MYSQL`, `SPANNER`.
*/
databaseType?: pulumi.Input<string>;
/**
* Indicates if the dataproc metastore should be protected against accidental deletions.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* Information used to configure the Dataproc Metastore service to encrypt
* customer data at rest.
* Structure is documented below.
*/
encryptionConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceEncryptionConfig>;
/**
* Configuration information specific to running Hive metastore software as the metastore service.
* Structure is documented below.
*/
hiveMetastoreConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceHiveMetastoreConfig>;
/**
* User-defined labels for the metastore service.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The location where the metastore service should reside.
* The default value is `global`.
*/
location?: pulumi.Input<string>;
/**
* The one hour maintenance window of the metastore service.
* This specifies when the service can be restarted for maintenance purposes in UTC time.
* Maintenance window is not needed for services with the `SPANNER` database type.
* Structure is documented below.
*/
maintenanceWindow?: pulumi.Input<inputs.dataproc.MetastoreServiceMaintenanceWindow>;
/**
* The setting that defines how metastore metadata should be integrated with external services and systems.
* Structure is documented below.
*/
metadataIntegration?: pulumi.Input<inputs.dataproc.MetastoreServiceMetadataIntegration>;
/**
* The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:
* "projects/{projectNumber}/global/networks/{network_id}".
*/
network?: pulumi.Input<string>;
/**
* The configuration specifying the network settings for the Dataproc Metastore service.
* Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceNetworkConfig>;
/**
* The TCP port at which the metastore service is reached. Default: 9083.
*/
port?: pulumi.Input<number>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The release channel of the service. If unspecified, defaults to `STABLE`.
* Default value is `STABLE`.
* Possible values are: `CANARY`, `STABLE`.
*/
releaseChannel?: pulumi.Input<string>;
/**
* Represents the scaling configuration of a metastore service.
* Structure is documented below.
*/
scalingConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceScalingConfig>;
/**
* The configuration of scheduled backup for the metastore service.
* Structure is documented below.
*/
scheduledBackup?: pulumi.Input<inputs.dataproc.MetastoreServiceScheduledBackup>;
/**
* The ID of the metastore service. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
* and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between
* 3 and 63 characters.
*
*
* - - -
*/
serviceId?: pulumi.Input<string>;
/**
* The configuration specifying telemetry settings for the Dataproc Metastore service. If unspecified defaults to JSON.
* Structure is documented below.
*/
telemetryConfig?: pulumi.Input<inputs.dataproc.MetastoreServiceTelemetryConfig>;
/**
* The tier of the service.
* Possible values are: `DEVELOPER`, `ENTERPRISE`.
*/
tier?: pulumi.Input<string>;
}