| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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: "Cloud (Stackdriver) Logging" |
| description: |- |
| Describes a BigQuery linked dataset |
| --- |
| |
| # google_logging_linked_dataset |
| |
| Describes a BigQuery linked dataset |
| |
| |
| To get more information about LinkedDataset, see: |
| |
| * [API documentation](https://cloud.google.com/logging/docs/reference/v2/rest/v2/locations.buckets.links) |
| * How-to Guides |
| * [Official Documentation](https://cloud.google.com/logging/docs/apis) |
| |
| ## Example Usage - Logging Linked Dataset Basic |
| |
| |
| ```hcl |
| resource "google_logging_project_bucket_config" "logging_linked_dataset" { |
| location = "global" |
| project = "my-project-name" |
| enable_analytics = true |
| bucket_id = "my-bucket" |
| } |
| |
| resource "google_logging_linked_dataset" "logging_linked_dataset" { |
| link_id = "mylink" |
| bucket = google_logging_project_bucket_config.logging_linked_dataset.id |
| description = "Linked dataset test" |
| } |
| ``` |
| ## Example Usage - Logging Linked Dataset All Params |
| |
| |
| ```hcl |
| resource "google_logging_project_bucket_config" "logging_linked_dataset" { |
| location = "global" |
| project = "my-project-name" |
| enable_analytics = true |
| bucket_id = "my-bucket" |
| } |
| |
| resource "google_logging_linked_dataset" "logging_linked_dataset" { |
| link_id = "mylink" |
| bucket = "my-bucket" |
| parent = "projects/my-project-name" |
| location = "global" |
| description = "Linked dataset test" |
| |
| depends_on = ["google_logging_project_bucket_config.logging_linked_dataset"] |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `link_id` - |
| (Required) |
| The id of the linked dataset. |
| |
| * `bucket` - |
| (Required) |
| The bucket to which the linked dataset is attached. |
| |
| |
| - - - |
| |
| |
| * `description` - |
| (Optional) |
| Describes this link. The maximum length of the description is 8000 characters. |
| |
| * `parent` - |
| (Optional) |
| The parent of the linked dataset. |
| |
| * `location` - |
| (Optional) |
| The location of the linked dataset. |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{parent}}/locations/{{location}}/buckets/{{bucket}}/links/{{link_id}}` |
| |
| * `name` - |
| The resource name of the linked dataset. The name can have up to 100 characters. A valid link id |
| (at the end of the link name) must only have alphanumeric characters and underscores within it. |
| |
| * `create_time` - |
| Output only. The creation timestamp of the link. 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". |
| |
| * `lifecycle_state` - |
| Output only. The linked dataset lifecycle state. |
| |
| * `bigquery_dataset` - |
| The information of a BigQuery Dataset. When a link is created, a BigQuery dataset is created along |
| with it, in the same project as the LogBucket it's linked to. This dataset will also have BigQuery |
| Views corresponding to the LogViews in the bucket. |
| Structure is [documented below](#nested_bigquery_dataset). |
| |
| |
| <a name="nested_bigquery_dataset"></a>The `bigquery_dataset` block contains: |
| |
| * `dataset_id` - |
| (Output) |
| Output only. The full resource name of the BigQuery dataset. The DATASET_ID will match the ID |
| of the link, so the link must match the naming restrictions of BigQuery datasets |
| (alphanumeric characters and underscores only). The dataset will have a resource path of |
| "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" |
| |
| ## 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. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| LinkedDataset can be imported using any of these accepted formats: |
| |
| * `{{parent}}/locations/{{location}}/buckets/{{bucket}}/links/{{link_id}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import LinkedDataset using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{parent}}/locations/{{location}}/buckets/{{bucket}}/links/{{link_id}}" |
| to = google_logging_linked_dataset.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), LinkedDataset can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_logging_linked_dataset.default {{parent}}/locations/{{location}}/buckets/{{bucket}}/links/{{link_id}} |
| ``` |