Skip to content

googleDataCatalogEntry

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:

Example Usage - Data Catalog Entry Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDataCatalogEntryGroupEntryGroup =
  new google.dataCatalogEntryGroup.DataCatalogEntryGroup(this, "entry_group", {
    entry_group_id: "my_group",
  });
new google.dataCatalogEntry.DataCatalogEntry(this, "basic_entry", {
  entry_group: googleDataCatalogEntryGroupEntryGroup.id,
  entry_id: "my_entry",
  user_specified_system: "SomethingExternal",
  user_specified_type: "my_custom_type",
});

Example Usage - Data Catalog Entry Fileset

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDataCatalogEntryGroupEntryGroup =
  new google.dataCatalogEntryGroup.DataCatalogEntryGroup(this, "entry_group", {
    entry_group_id: "my_group",
  });
new google.dataCatalogEntry.DataCatalogEntry(this, "basic_entry", {
  entry_group: googleDataCatalogEntryGroupEntryGroup.id,
  entry_id: "my_entry",
  gcs_fileset_spec: [
    {
      file_patterns: ["gs://fake_bucket/dir/*"],
    },
  ],
  type: "FILESET",
});

Example Usage - Data Catalog Entry Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDataCatalogEntryGroupEntryGroup =
  new google.dataCatalogEntryGroup.DataCatalogEntryGroup(this, "entry_group", {
    entry_group_id: "my_group",
  });
new google.dataCatalogEntry.DataCatalogEntry(this, "basic_entry", {
  description: "a custom type entry for a user specified system",
  display_name: "my custom type entry",
  entry_group: googleDataCatalogEntryGroupEntryGroup.id,
  entry_id: "my_entry",
  linked_resource: "my/linked/resource",
  schema:
    '{\n  "columns": [\n    {\n      "column": "first_name",\n      "description": "First name",\n      "mode": "REQUIRED",\n      "type": "STRING"\n    },\n    {\n      "column": "last_name",\n      "description": "Last name",\n      "mode": "REQUIRED",\n      "type": "STRING"\n    },\n    {\n      "column": "address",\n      "description": "Address",\n      "mode": "REPEATED",\n      "subcolumns": [\n        {\n          "column": "city",\n          "description": "City",\n          "mode": "NULLABLE",\n          "type": "STRING"\n        },\n        {\n          "column": "state",\n          "description": "State",\n          "mode": "NULLABLE",\n          "type": "STRING"\n        }\n      ],\n      "type": "RECORD"\n    }\n  ]\n}\n',
  user_specified_system: "Something_custom",
  user_specified_type: "my_user_specified_type",
});

Argument Reference

The following arguments are supported:

  • entryGroup - (Required) The name of the entry group this entry is in.

  • entryId - (Required) The id of the entry to create.


  • linkedResource - (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.

  • displayName - (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.

  • userSpecifiedType - (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.

  • userSpecifiedSystem - (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.

  • gcsFilesetSpec - (Optional) Specification that applies to a Cloud Storage fileset. This is only valid on entries of type FILESET. Structure is documented below.

The gcsFilesetSpec block supports:

  • filePatterns - (Required) Patterns to identify a set of files in Google Cloud Storage. See Cloud Storage documentation 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
  • sampleGcsFileSpecs - (Output) Sample files contained in this fileset, not all files contained in this fileset are represented here. Structure is documented below.

The sampleGcsFileSpecs block contains:

  • filePath - (Output) The full file path

  • sizeBytes - (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.

  • integratedSystem - This field indicates the entry's source system that Data Catalog integrates with, such as BigQuery or Pub/Sub.

  • bigqueryTableSpec - Specification that applies to a BigQuery table. This is only valid on entries of type TABLE. Structure is documented below.

  • bigqueryDateShardedSpec - 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.

The bigqueryTableSpec block contains:

  • tableSourceType - (Output) The table source type.

  • viewSpec - (Output) Table view specification. This field should only be populated if tableSourceType is BIGQUERY_VIEW. Structure is documented below.

  • tableSpec - (Output) Spec of a BigQuery table. This field should only be populated if tableSourceType is BIGQUERY_TABLE. Structure is documented below.

The viewSpec block contains:

  • viewQuery - (Output) The query that defines the table view.

The tableSpec block contains:

  • groupedEntry - (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.

The bigqueryDateShardedSpec 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}

  • tablePrefix - (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.

  • shardCount - (Output) Total number of shards.

Timeouts

This resource provides the following 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:

$ terraform import google_data_catalog_entry.default {{name}}

User Project Overrides

This resource supports User Project Overrides.