Skip to content

Commit cb1cc4c

Browse files
glue crawler
1 parent 34747a4 commit cb1cc4c

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
resource "aws_glue_crawler" "event_crawler" {
2+
name = "event-crawler-${aws_glue_catalog_table.event_table.name}"
3+
database_name = aws_glue_catalog_database.supplier.name
4+
role = aws_iam_role.glue_role.arn
5+
6+
table_prefix = ""
7+
s3_target {
8+
path = "s3://${aws_s3_bucket.event_reporting.bucket}/events/"
9+
}
10+
recrawl_policy {
11+
recrawl_behavior = "CRAWL_EVERYTHING"
12+
}
13+
14+
configuration = jsonencode({
15+
Version = 1.0
16+
CrawlerOutput = {
17+
Partitions = {
18+
AddOrUpdateBehavior = "InheritFromTable"
19+
}
20+
}
21+
})
22+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
resource "aws_iam_role" "glue_role" {
2+
name = "${local.csi}-glue-role"
3+
assume_role_policy = data.aws_iam_policy_document.glue_assume_role.json
4+
}
5+
6+
data "aws_iam_policy_document" "glue_assume_role" {
7+
statement {
8+
effect = "Allow"
9+
10+
principals {
11+
type = "Service"
12+
identifiers = ["sns.amazonaws.com"]
13+
}
14+
15+
actions = ["sts:AssumeRole"]
16+
}
17+
}

0 commit comments

Comments
 (0)