AWS Glue Classifier
This page shows how to write Terraform and CloudFormation for AWS Glue Classifier and write them securely.
aws_glue_classifier (Terraform)
The Classifier in AWS Glue can be configured in Terraform with the resource name aws_glue_classifier
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_glue_classifier" "example" {
name = "example"
csv_classifier {
allow_single_column = false
contains_header = "PRESENT"
resource "aws_glue_classifier" "this" {
name = var.name
dynamic "csv_classifier" {
for_each = var.csv_classifier
content {
Parameters
-
id
optional computed - string -
name
required - string -
csv_classifier
list block-
allow_single_column
optional - bool -
contains_header
optional - string -
delimiter
optional - string -
disable_value_trimming
optional - bool -
header
optional - list of string -
quote_symbol
optional - string
-
-
grok_classifier
list block-
classification
required - string -
custom_patterns
optional - string -
grok_pattern
required - string
-
-
json_classifier
list block-
json_path
required - string
-
-
xml_classifier
list block-
classification
required - string -
row_tag
required - string
-
Explanation in Terraform Registry
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.
AWS::Glue::Classifier (CloudFormation)
The Classifier in Glue can be configured in CloudFormation with the resource name AWS::Glue::Classifier
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::Glue::Classifier
Properties:
CsvClassifier:
CsvClassifier
GrokClassifier:
GrokClassifier
Type: AWS::Glue::Classifier
Properties:
GrokClassifier:
Name: "CrawlerClassifier"
Classification: "wikiData"
GrokPattern: "%{NOTSPACE:language} %{NOTSPACE:page_title} %{NUMBER:hits:long} %{NUMBER:retrieved_size:long}"
# Type: AWS::Glue::Classifier
# Properties:
# GrokClassifier:
# Name: "CrawlerClassifier"
# Classification: "wikiData"
# GrokPattern: "%{NOTSPACE:language} %{NOTSPACE:page_title} %{NUMBER:hits:long} %{NUMBER:retrieved_size:long}"
Type: AWS::Glue::Classifier
Type: AWS::Glue::Classifier
Properties:
CsvClassifier:
AllowSingleColumn: false
ContainsHeader: ABSENT
Delimiter: ' '
"Type": "AWS::Glue::Classifier",
"Properties": {
"JsonClassifier": {
"Name": "json_classifier",
"JsonPath" : "$[*]"
}
"AWS::Glue::Classifier.XMLClassifier": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html",
"Properties": {
"RowTag": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html#cfn-glue-classifier-xmlclassifier-rowtag",
"AWS::Glue::Classifier.XMLClassifier": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html",
"Properties": {
"RowTag": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html#cfn-glue-classifier-xmlclassifier-rowtag",
"AWS::Glue::Classifier.XMLClassifier": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html",
"Properties": {
"RowTag": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-classifier-xmlclassifier.html#cfn-glue-classifier-xmlclassifier-rowtag",
"Type": "AWS::Glue::Classifier",
"Properties": {
"CsvClassifier": {
"Name": "classifier-gdelt-csv",
"Delimiter": "\t",
"QuoteSymbol": "\"",
Parameters
-
XMLClassifier
optional - XMLClassifier -
JsonClassifier
optional - JsonClassifier -
CsvClassifier
optional - CsvClassifier -
GrokClassifier
optional - GrokClassifier
Explanation in CloudFormation Registry
The
AWS::Glue::Classifier
resource creates an AWS Glue classifier that categorizes data sources and specifies schemas. For more information, see Adding Classifiers to a Crawler and Classifier Structure in the AWS Glue Developer Guide.
Frequently asked questions
What is AWS Glue Classifier?
AWS Glue Classifier is a resource for Glue of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Glue Classifier?
For Terraform, the akemyy/beer and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the MohamedMesrah/SAM-Resources, ozzyince/notes-api and d-smith/glue-athena-s3 source code examples are useful. See the CloudFormation Example section for further details.