A managed metastore federation.
resource "google_dataproc_metastore_federation" "default" {
provider = google-beta
location = "us-central1"
federation_id = ""
version = "3.1.2"
backend_metastores {
rank = "1"
name = google_dataproc_metastore_service.default.id
metastore_type = "DATAPROC_METASTORE"
}
}
resource "google_dataproc_metastore_service" "default" {
provider = google-beta
service_id = ""
location = "us-central1"
tier = "DEVELOPER"
hive_metastore_config {
version = "3.1.2"
endpoint_protocol = "GRPC"
}
}
resource "google_dataproc_metastore_federation" "default" {
provider = google-beta
location = "us-central1"
federation_id = ""
version = "3.1.2"
backend_metastores {
rank = "2"
name = data.google_project.project.id
metastore_type = "BIGQUERY"
}
backend_metastores {
rank = "1"
name = google_dataproc_metastore_service.default.id
metastore_type = "DATAPROC_METASTORE"
}
}
resource "google_dataproc_metastore_service" "default" {
provider = google-beta
service_id = ""
location = "us-central1"
tier = "DEVELOPER"
hive_metastore_config {
version = "3.1.2"
endpoint_protocol = "GRPC"
}
}
data "google_project" "project" {
provider = google-beta
}
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.
backend_metastores
-
(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.
federation_id
-
(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 backend_metastores
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}
metastore_type
-
(Required)
The type of the backend metastore.
Possible values are: METASTORE_TYPE_UNSPECIFIED
, DATAPROC_METASTORE
, BIGQUERY
.
labels
-
(Optional)
User-defined labels for the metastore federation.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
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.
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/{{federation_id}}
name
-
The relative resource name of the metastore federation.
endpoint_uri
-
The URI of the endpoint used to access the metastore federation.
state
-
The current state of the metastore federation.
state_message
-
Additional information about the current state of the metastore federation, if available.
uid
-
The globally unique resource identifier of the metastore federation.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Federation can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/federations/{{federation_id}}
{{project}}/{{location}}/{{federation_id}}
{{location}}/{{federation_id}}
In Terraform v1.5.0 and later, use an import
block to import Federation using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/federations/{{federation_id}}"
to = google_dataproc_metastore_federation.default
}
When using the terraform import
command, Federation can be imported using one of the formats above. For example:
$ 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}}
This resource supports User Project Overrides.