Class MetastoreService


  • public class MetastoreService
    extends com.pulumi.resources.CustomResource
    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 ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.dataproc.MetastoreService; import com.pulumi.gcp.dataproc.MetastoreServiceArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceMaintenanceWindowArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var default_ = new MetastoreService("default", MetastoreServiceArgs.builder() .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder() .version("2.3.6") .build()) .location("us-central1") .maintenanceWindow(MetastoreServiceMaintenanceWindowArgs.builder() .dayOfWeek("SUNDAY") .hourOfDay(2) .build()) .port(9080) .serviceId("metastore-srv") .tier("DEVELOPER") .build()); } } ``` ### Dataproc Metastore Service Cmek Example ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.kms.KeyRing; import com.pulumi.gcp.kms.KeyRingArgs; import com.pulumi.gcp.kms.CryptoKey; import com.pulumi.gcp.kms.CryptoKeyArgs; import com.pulumi.gcp.dataproc.MetastoreService; import com.pulumi.gcp.dataproc.MetastoreServiceArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceEncryptionConfigArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs; import com.pulumi.resources.CustomResourceOptions; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var keyRing = new KeyRing("keyRing", KeyRingArgs.builder() .location("us-central1") .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder() .keyRing(keyRing.id()) .purpose("ENCRYPT_DECRYPT") .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var default_ = new MetastoreService("default", MetastoreServiceArgs.builder() .serviceId("example-service") .location("us-central1") .encryptionConfig(MetastoreServiceEncryptionConfigArgs.builder() .kmsKey(cryptoKey.id()) .build()) .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder() .version("3.1.2") .build()) .build()); } } ``` ### Dataproc Metastore Service Private Service Connect ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.Network; import com.pulumi.gcp.compute.NetworkArgs; import com.pulumi.gcp.compute.Subnetwork; import com.pulumi.gcp.compute.SubnetworkArgs; import com.pulumi.gcp.dataproc.MetastoreService; import com.pulumi.gcp.dataproc.MetastoreServiceArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceNetworkConfigArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var net = new Network("net", NetworkArgs.builder() .autoCreateSubnetworks(false) .build()); var subnet = new Subnetwork("subnet", SubnetworkArgs.builder() .region("us-central1") .network(net.id()) .ipCidrRange("10.0.0.0/22") .privateIpGoogleAccess(true) .build()); var default_ = new MetastoreService("default", MetastoreServiceArgs.builder() .serviceId("metastore-srv") .location("us-central1") .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder() .version("3.1.2") .build()) .networkConfig(MetastoreServiceNetworkConfigArgs.builder() .consumers(MetastoreServiceNetworkConfigConsumerArgs.builder() .subnetwork(subnet.id()) .build()) .build()) .build()); } } ``` ### Dataproc Metastore Service Dpms2 ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.dataproc.MetastoreService; import com.pulumi.gcp.dataproc.MetastoreServiceArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceScalingConfigArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var dpms2 = new MetastoreService("dpms2", MetastoreServiceArgs.builder() .databaseType("SPANNER") .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder() .version("3.1.2") .build()) .location("us-central1") .scalingConfig(MetastoreServiceScalingConfigArgs.builder() .instanceSize("EXTRA_SMALL") .build()) .serviceId("dpms2") .build()); } } ``` ### Dataproc Metastore Service Dpms2 Scaling Factor ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.dataproc.MetastoreService; import com.pulumi.gcp.dataproc.MetastoreServiceArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs; import com.pulumi.gcp.dataproc.inputs.MetastoreServiceScalingConfigArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var dpms2ScalingFactor = new MetastoreService("dpms2ScalingFactor", MetastoreServiceArgs.builder() .databaseType("SPANNER") .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder() .version("3.1.2") .build()) .location("us-central1") .scalingConfig(MetastoreServiceScalingConfigArgs.builder() .scalingFactor("2") .build()) .serviceId("dpms2sf") .build()); } } ``` ## Import Service can be imported using any of these accepted formats ```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}} ```
    • Constructor Detail

      • MetastoreService

        public MetastoreService​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • MetastoreService

        public MetastoreService​(java.lang.String name,
                                MetastoreServiceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • MetastoreService

        public MetastoreService​(java.lang.String name,
                                MetastoreServiceArgs args,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • artifactGcsUri

        public com.pulumi.core.Output<java.lang.String> artifactGcsUri()
        Returns:
        A Cloud Storage URI (starting with gs://) that specifies where artifacts related to the metastore service are stored.
      • databaseType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> databaseType()
        Returns:
        The database type that the Metastore service stores its data. Default value is `MYSQL`. Possible values are: `MYSQL`, `SPANNER`.
      • encryptionConfig

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceEncryptionConfig>> encryptionConfig()
        Returns:
        Information used to configure the Dataproc Metastore service to encrypt customer data at rest. Structure is documented below.
      • endpointUri

        public com.pulumi.core.Output<java.lang.String> endpointUri()
        Returns:
        (Output) The URI of the endpoint used to access the metastore service.
      • hiveMetastoreConfig

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceHiveMetastoreConfig>> hiveMetastoreConfig()
        Returns:
        Configuration information specific to running Hive metastore software as the metastore service. Structure is documented below.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        User-defined labels for the metastore service.
      • location

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> location()
        Returns:
        The location where the metastore service should reside. The default value is `global`.
      • maintenanceWindow

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceMaintenanceWindow>> maintenanceWindow()
        Returns:
        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.
      • metadataIntegration

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceMetadataIntegration>> metadataIntegration()
        Returns:
        The setting that defines how metastore metadata should be integrated with external services and systems.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The relative resource name of the metastore service.
      • network

        public com.pulumi.core.Output<java.lang.String> network()
        Returns:
        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}".
      • networkConfig

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceNetworkConfig>> networkConfig()
        Returns:
        The configuration specifying the network settings for the Dataproc Metastore service. Structure is documented below.
      • port

        public com.pulumi.core.Output<java.lang.Integer> port()
        Returns:
        The TCP port at which the metastore service is reached. Default: 9083.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • releaseChannel

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> releaseChannel()
        Returns:
        The release channel of the service. If unspecified, defaults to `STABLE`. Default value is `STABLE`. Possible values are: `CANARY`, `STABLE`.
      • scalingConfig

        public com.pulumi.core.Output<java.util.Optional<MetastoreServiceScalingConfig>> scalingConfig()
        Returns:
        Represents the scaling configuration of a metastore service. Structure is documented below.
      • serviceId

        public com.pulumi.core.Output<java.lang.String> serviceId()
        Returns:
        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. ***
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        The current state of the metastore service.
      • stateMessage

        public com.pulumi.core.Output<java.lang.String> stateMessage()
        Returns:
        Additional information about the current state of the metastore service, if available.
      • telemetryConfig

        public com.pulumi.core.Output<MetastoreServiceTelemetryConfig> telemetryConfig()
        Returns:
        The configuration specifying telemetry settings for the Dataproc Metastore service. If unspecified defaults to JSON. Structure is documented below.
      • tier

        public com.pulumi.core.Output<java.lang.String> tier()
        Returns:
        The tier of the service. Possible values are: `DEVELOPER`, `ENTERPRISE`.
      • uid

        public com.pulumi.core.Output<java.lang.String> uid()
        Returns:
        The globally unique resource identifier of the metastore service.
      • get

        public static MetastoreService get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           MetastoreServiceState state,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.