blob: 5accd9a154835c897e9520b5ca845269f0dbc1a9 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** 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: "Data catalog"
description: |-
Entry Metadata.
---
# google\_data\_catalog\_entry
Entry Metadata. A Data Catalog Entry resource represents another resource in Google Cloud Platform
(such as a BigQuery dataset or a Pub/Sub topic) or outside of Google Cloud Platform. Clients can use
the linkedResource field in the Entry resource to refer to the original resource ID of the source system.
An Entry resource contains resource details, such as its schema. An Entry can also be used to attach
flexible metadata, such as a Tag.
To get more information about Entry, see:
* [API documentation](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries)
* How-to Guides
* [Official Documentation](https://cloud.google.com/data-catalog/docs)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=data_catalog_entry_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Data Catalog Entry Basic
```hcl
resource "google_data_catalog_entry" "basic_entry" {
entry_group = google_data_catalog_entry_group.entry_group.id
entry_id = "my_entry"
user_specified_type = "my_custom_type"
user_specified_system = "SomethingExternal"
}
resource "google_data_catalog_entry_group" "entry_group" {
entry_group_id = "my_group"
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=data_catalog_entry_fileset&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Data Catalog Entry Fileset
```hcl
resource "google_data_catalog_entry" "basic_entry" {
entry_group = google_data_catalog_entry_group.entry_group.id
entry_id = "my_entry"
type = "FILESET"
gcs_fileset_spec {
file_patterns = ["gs://fake_bucket/dir/*"]
}
}
resource "google_data_catalog_entry_group" "entry_group" {
entry_group_id = "my_group"
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=data_catalog_entry_full&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Data Catalog Entry Full
```hcl
resource "google_data_catalog_entry" "basic_entry" {
entry_group = google_data_catalog_entry_group.entry_group.id
entry_id = "my_entry"
user_specified_type = "my_user_specified_type"
user_specified_system = "Something_custom"
linked_resource = "my/linked/resource"
display_name = "my custom type entry"
description = "a custom type entry for a user specified system"
schema = <<EOF
{
"columns": [
{
"column": "first_name",
"description": "First name",
"mode": "REQUIRED",
"type": "STRING"
},
{
"column": "last_name",
"description": "Last name",
"mode": "REQUIRED",
"type": "STRING"
},
{
"column": "address",
"description": "Address",
"mode": "REPEATED",
"subcolumns": [
{
"column": "city",
"description": "City",
"mode": "NULLABLE",
"type": "STRING"
},
{
"column": "state",
"description": "State",
"mode": "NULLABLE",
"type": "STRING"
}
],
"type": "RECORD"
}
]
}
EOF
}
resource "google_data_catalog_entry_group" "entry_group" {
entry_group_id = "my_group"
}
```
## Argument Reference
The following arguments are supported:
* `entry_group` -
(Required)
The name of the entry group this entry is in.
* `entry_id` -
(Required)
The id of the entry to create.
- - -
* `linked_resource` -
(Optional)
The resource this metadata entry refers to.
For Google Cloud Platform resources, linkedResource is the full name of the resource.
For example, the linkedResource for a table resource from BigQuery is:
//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId
Output only when Entry is of type in the EntryType enum. For entries with userSpecifiedType,
this field is optional and defaults to an empty string.
* `display_name` -
(Optional)
Display information such as title and description. A short name to identify the entry,
for example, "Analytics Data - Jan 2011".
* `description` -
(Optional)
Entry description, which can consist of several sentences or paragraphs that describe entry contents.
* `schema` -
(Optional)
Schema of the entry (e.g. BigQuery, GoogleSQL, Avro schema), as a json string. An entry might not have any schema
attached to it. See
https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries#schema
for what fields this schema can contain.
* `type` -
(Optional)
The type of the entry. Only used for Entries with types in the EntryType enum.
Currently, only FILESET enum value is allowed. All other entries created through Data Catalog must use userSpecifiedType.
Possible values are: `FILESET`.
* `user_specified_type` -
(Optional)
Entry type if it does not fit any of the input-allowed values listed in EntryType enum above.
When creating an entry, users should check the enum values first, if nothing matches the entry
to be created, then provide a custom value, for example "my_special_type".
userSpecifiedType strings must begin with a letter or underscore and can only contain letters,
numbers, and underscores; are case insensitive; must be at least 1 character and at most 64 characters long.
* `user_specified_system` -
(Optional)
This field indicates the entry's source system that Data Catalog does not integrate with.
userSpecifiedSystem strings must begin with a letter or underscore and can only contain letters, numbers,
and underscores; are case insensitive; must be at least 1 character and at most 64 characters long.
* `gcs_fileset_spec` -
(Optional)
Specification that applies to a Cloud Storage fileset. This is only valid on entries of type FILESET.
Structure is [documented below](#nested_gcs_fileset_spec).
<a name="nested_gcs_fileset_spec"></a>The `gcs_fileset_spec` block supports:
* `file_patterns` -
(Required)
Patterns to identify a set of files in Google Cloud Storage.
See [Cloud Storage documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames)
for more information. Note that bucket wildcards are currently not supported. Examples of valid filePatterns:
* gs://bucket_name/dir/*: matches all files within bucket_name/dir directory.
* gs://bucket_name/dir/**: matches all files in bucket_name/dir spanning all subdirectories.
* gs://bucket_name/file*: matches files prefixed by file in bucket_name
* gs://bucket_name/??.txt: matches files with two characters followed by .txt in bucket_name
* gs://bucket_name/[aeiou].txt: matches files that contain a single vowel character followed by .txt in bucket_name
* gs://bucket_name/[a-m].txt: matches files that contain a, b, ... or m followed by .txt in bucket_name
* gs://bucket_name/a/*/b: matches all files in bucket_name that match a/*/b pattern, such as a/c/b, a/d/b
* gs://another_bucket/a.txt: matches gs://another_bucket/a.txt
* `sample_gcs_file_specs` -
(Output)
Sample files contained in this fileset, not all files contained in this fileset are represented here.
Structure is [documented below](#nested_sample_gcs_file_specs).
<a name="nested_sample_gcs_file_specs"></a>The `sample_gcs_file_specs` block contains:
* `file_path` -
(Output)
The full file path
* `size_bytes` -
(Output)
The size of the file, in bytes.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `{{name}}`
* `name` -
The Data Catalog resource name of the entry in URL format.
Example: projects/{project_id}/locations/{location}/entryGroups/{entryGroupId}/entries/{entryId}.
Note that this Entry and its child resources may not actually be stored in the location in this name.
* `integrated_system` -
This field indicates the entry's source system that Data Catalog integrates with, such as BigQuery or Pub/Sub.
* `bigquery_table_spec` -
Specification that applies to a BigQuery table. This is only valid on entries of type TABLE.
Structure is [documented below](#nested_bigquery_table_spec).
* `bigquery_date_sharded_spec` -
Specification for a group of BigQuery tables with name pattern [prefix]YYYYMMDD.
Context: https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding.
Structure is [documented below](#nested_bigquery_date_sharded_spec).
<a name="nested_bigquery_table_spec"></a>The `bigquery_table_spec` block contains:
* `table_source_type` -
(Output)
The table source type.
* `view_spec` -
(Output)
Table view specification. This field should only be populated if tableSourceType is BIGQUERY_VIEW.
Structure is [documented below](#nested_view_spec).
* `table_spec` -
(Output)
Spec of a BigQuery table. This field should only be populated if tableSourceType is BIGQUERY_TABLE.
Structure is [documented below](#nested_table_spec).
<a name="nested_view_spec"></a>The `view_spec` block contains:
* `view_query` -
(Output)
The query that defines the table view.
<a name="nested_table_spec"></a>The `table_spec` block contains:
* `grouped_entry` -
(Output)
If the table is a dated shard, i.e., with name pattern [prefix]YYYYMMDD, groupedEntry is the
Data Catalog resource name of the date sharded grouped entry, for example,
projects/{project_id}/locations/{location}/entrygroups/{entryGroupId}/entries/{entryId}.
Otherwise, groupedEntry is empty.
<a name="nested_bigquery_date_sharded_spec"></a>The `bigquery_date_sharded_spec` block contains:
* `dataset` -
(Output)
The Data Catalog resource name of the dataset entry the current table belongs to, for example,
projects/{project_id}/locations/{location}/entrygroups/{entryGroupId}/entries/{entryId}
* `table_prefix` -
(Output)
The table name prefix of the shards. The name of any given shard is [tablePrefix]YYYYMMDD,
for example, for shard MyTable20180101, the tablePrefix is MyTable.
* `shard_count` -
(Output)
Total number of shards.
## 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
Entry can be imported using any of these accepted formats:
* `{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Entry using one of the formats above. For example:
```tf
import {
id = "{{name}}"
to = google_data_catalog_entry.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Entry can be imported using one of the formats above. For example:
```
$ terraform import google_data_catalog_entry.default {{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).