Skip to content

googleDataprocMetastoreFederation

A managed metastore federation.

\~> Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

Example Usage - Dataproc Metastore Federation Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDataprocMetastoreServiceDefault =
  new google.dataprocMetastoreService.DataprocMetastoreService(
    this,
    "default",
    {
      hive_metastore_config: [
        {
          endpoint_protocol: "GRPC",
          version: "3.1.2",
        },
      ],
      location: "us-central1",
      provider: "${google-beta}",
      service_id: "",
      tier: "DEVELOPER",
    }
  );
const googleDataprocMetastoreFederationDefault =
  new google.dataprocMetastoreFederation.DataprocMetastoreFederation(
    this,
    "default_1",
    {
      backend_metastores: [
        {
          metastore_type: "DATAPROC_METASTORE",
          name: googleDataprocMetastoreServiceDefault.id,
          rank: "1",
        },
      ],
      federation_id: "",
      location: "us-central1",
      provider: "${google-beta}",
      version: "3.1.2",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleDataprocMetastoreFederationDefault.overrideLogicalId("default");

Example Usage - Dataproc Metastore Federation Bigquery

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDataprocMetastoreServiceDefault =
  new google.dataprocMetastoreService.DataprocMetastoreService(
    this,
    "default",
    {
      hive_metastore_config: [
        {
          endpoint_protocol: "GRPC",
          version: "3.1.2",
        },
      ],
      location: "us-central1",
      provider: "${google-beta}",
      service_id: "",
      tier: "DEVELOPER",
    }
  );
const dataGoogleProjectProject = new google.dataGoogleProject.DataGoogleProject(
  this,
  "project",
  {
    provider: "${google-beta}",
  }
);
const googleDataprocMetastoreFederationDefault =
  new google.dataprocMetastoreFederation.DataprocMetastoreFederation(
    this,
    "default_2",
    {
      backend_metastores: [
        {
          metastore_type: "BIGQUERY",
          name: dataGoogleProjectProject.id,
          rank: "2",
        },
        {
          metastore_type: "DATAPROC_METASTORE",
          name: googleDataprocMetastoreServiceDefault.id,
          rank: "1",
        },
      ],
      federation_id: "",
      location: "us-central1",
      provider: "${google-beta}",
      version: "3.1.2",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleDataprocMetastoreFederationDefault.overrideLogicalId("default");

Argument Reference

The following arguments are supported:

  • version - (Required) The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.

  • backendMetastores - (Required) A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number. Structure is documented below.

  • federationId - (Required) The ID of the metastore federation. 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.

The backendMetastores block supports:

  • rank - (Required) The identifier for this object. Format specified above.

  • name - (Required) The relative resource name of the metastore that is being federated. The formats of the relative resource names for the currently supported metastores are listed below: Dataplex: projects/{projectId}/locations/{location}/lakes/{lake_id} BigQuery: projects/{projectId} Dataproc Metastore: projects/{projectId}/locations/{location}/services/{serviceId}

  • metastoreType - (Required) The type of the backend metastore. Possible values are metastoreTypeUnspecified, dataprocMetastore, and bigquery.


  • labels - (Optional) User-defined labels for the metastore federation.

  • location - (Optional) The location where the metastore federation should reside.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/federations/{{federationId}}

  • name - The relative resource name of the metastore federation.

  • endpointUri - The URI of the endpoint used to access the metastore federation.

  • state - The current state of the metastore federation.

  • stateMessage - Additional information about the current state of the metastore federation, if available.

  • uid - The globally unique resource identifier of the metastore federation.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

Federation can be imported using any of these accepted formats:

$ terraform import google_dataproc_metastore_federation.default projects/{{project}}/locations/{{location}}/federations/{{federation_id}}
$ terraform import google_dataproc_metastore_federation.default {{project}}/{{location}}/{{federation_id}}
$ terraform import google_dataproc_metastore_federation.default {{location}}/{{federation_id}}

User Project Overrides

This resource supports User Project Overrides.