| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Dataproc metastore" |
| description: |- |
| A managed metastore federation. |
| --- |
| |
| # google\_dataproc\_metastore\_federation |
| |
| A managed metastore federation. |
| |
| ~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. |
| See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. |
| |
| |
| ## Example Usage - Dataproc Metastore Federation Basic |
| |
| |
| ```hcl |
| 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" |
| } |
| } |
| ``` |
| ## Example Usage - Dataproc Metastore Federation Bigquery |
| |
| |
| ```hcl |
| 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 |
| } |
| ``` |
| |
| ## 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. |
| |
| * `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](#nested_backend_metastores). |
| |
| * `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. |
| |
| |
| <a name="nested_backend_metastores"></a>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. |
| |
| |
| ## 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/{{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. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-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: |
| |
| * `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](https://developer.hashicorp.com/terraform/language/import) to import Federation using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/locations/{{location}}/federations/{{federation_id}}" |
| to = google_dataproc_metastore_federation.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |