Skip to content

Resource: awsGlueClassifier

Provides a Glue Classifier resource.

\~> NOTE: It is only valid to create one type of classifier (csv, grok, JSON, or XML). Changing classifier types will recreate the classifier.

Example Usage

Csv Classifier

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueClassifier.GlueClassifier(this, "example", {
  csvClassifier: {
    allowSingleColumn: false,
    containsHeader: "PRESENT",
    delimiter: ",",
    disableValueTrimming: false,
    header: ["example1", "example2"],
    quoteSymbol: "'",
  },
  name: "example",
});

Grok Classifier

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueClassifier.GlueClassifier(this, "example", {
  grokClassifier: {
    classification: "example",
    grokPattern: "example",
  },
  name: "example",
});

JSON Classifier

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueClassifier.GlueClassifier(this, "example", {
  jsonClassifier: {
    jsonPath: "example",
  },
  name: "example",
});

XML Classifier

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueClassifier.GlueClassifier(this, "example", {
  name: "example",
  xmlClassifier: {
    classification: "example",
    rowTag: "example",
  },
});

Argument Reference

The following arguments are supported:

  • csvClassifier - (Optional) A classifier for Csv content. Defined below.
  • grokClassifier – (Optional) A classifier that uses grok patterns. Defined below.
  • jsonClassifier – (Optional) A classifier for JSON content. Defined below.
  • name – (Required) The name of the classifier.
  • xmlClassifier – (Optional) A classifier for XML content. Defined below.

csvClassifier

  • allowSingleColumn - (Optional) Enables the processing of files that contain only one column.
  • containsHeader - (Optional) Indicates whether the CSV file contains a header. This can be one of "ABSENT", "PRESENT", or "UNKNOWN".
  • customDatatypeConfigured - (Optional) A custom symbol to denote what combines content into a single column value. It must be different from the column delimiter.
  • customDatatypes - (Optional) A list of supported custom datatypes. Valid values are binary, boolean, date, decimal, double, float, int, long, short, string, timestamp.
  • delimiter - (Optional) The delimiter used in the Csv to separate columns.
  • disableValueTrimming - (Optional) Specifies whether to trim column values.
  • header - (Optional) A list of strings representing column names.
  • quoteSymbol - (Optional) A custom symbol to denote what combines content into a single column value. It must be different from the column delimiter.

grokClassifier

  • classification - (Required) An identifier of the data format that the classifier matches, such as Twitter, JSON, Omniture logs, Amazon CloudWatch Logs, and so on.
  • customPatterns - (Optional) Custom grok patterns used by this classifier.
  • grokPattern - (Required) The grok pattern used by this classifier.

jsonClassifier

  • jsonPath - (Required) A jsonPath string defining the JSON data for the classifier to classify. AWS Glue supports a subset of jsonPath, as described in Writing JsonPath Custom Classifiers.

xmlClassifier

  • classification - (Required) An identifier of the data format that the classifier matches.
  • rowTag - (Required) The XML tag designating the element that contains each record in an XML document being parsed. Note that this cannot identify a self-closing element (closed by />). An empty row element that contains only attributes can be parsed as long as it ends with a closing tag (for example, <rowItemA="a"ItemB="b"></row> is okay, but <rowItemA="a"ItemB="b" /> is not).

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Name of the classifier

Import

Glue Classifiers can be imported using their name, e.g.,

$ terraform import aws_glue_classifier.MyClassifier MyClassifier