Databases are containers of tables.
To get more information about Database, see:
resource "google_biglake_catalog" "catalog" {
name = "my_catalog"
location = "US"
}
resource "google_storage_bucket" "bucket" {
name = "my_bucket"
location = "US"
force_destroy = true
uniform_bucket_level_access = true
}
resource "google_storage_bucket_object" "metadata_folder" {
name = "metadata/"
content = " "
bucket = google_storage_bucket.bucket.name
}
resource "google_biglake_database" "database" {
name = "my_database"
catalog = google_biglake_catalog.catalog.id
type = "HIVE"
hive_options {
location_uri = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.metadata_folder.name}"
parameters = {
"owner": "John Doe"
}
}
}
The following arguments are supported:
type
-
(Required)
The database type.
hive_options
-
(Required)
Options of a Hive database.
Structure is documented below.
catalog
-
(Required)
The parent catalog.
name
-
(Required)
The name of the database.
The hive_options
block supports:
location_uri
-
(Optional)
Cloud Storage folder URI where the database data is stored, starting with "gs://".
parameters
-
(Optional)
Stores user supplied Hive database parameters. An object containing a
list of"key": value pairs.
Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{catalog}}/databases/{{name}}
create_time
-
Output only. The creation time of the database. A timestamp in RFC3339
UTC "Zulu" format, with nanosecond resolution and up to nine fractional
digits. Examples: "2014-10-02T15:01:23Z" and
"2014-10-02T15:01:23.045123456Z".
update_time
-
Output only. The last modification time of the database. A timestamp in
RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine
fractional digits. Examples: "2014-10-02T15:01:23Z" and
"2014-10-02T15:01:23.045123456Z".
delete_time
-
Output only. The deletion time of the database. Only set after the
database is deleted. A timestamp in RFC3339 UTC "Zulu" format, with
nanosecond resolution and up to nine fractional digits. Examples:
"2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
expire_time
-
Output only. The time when this database is considered expired. Only set
after the database is deleted. A timestamp in RFC3339 UTC "Zulu" format,
with nanosecond resolution and up to nine fractional digits. Examples:
"2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Database can be imported using any of these accepted formats:
{{catalog}}/databases/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Database using one of the formats above. For example:
import {
id = "{{catalog}}/databases/{{name}}"
to = google_biglake_database.default
}
When using the terraform import
command, Database can be imported using one of the formats above. For example:
$ terraform import google_biglake_database.default {{catalog}}/databases/{{name}}