-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkinesis_analytics.tf
89 lines (74 loc) · 1.86 KB
/
kinesis_analytics.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
resource "aws_kinesis_analytics_application" "OrderRateAlarms" {
name = var.kinesis_analytics_application_name
code = file("./analytics-query.txt")
inputs {
name_prefix = "test_prefix"
kinesis_stream {
resource_arn = "${aws_kinesis_stream.CadabraOrders_s3_kinesis_data_stream.arn}"
role_arn = "${aws_iam_role.kinesisanalytics_role.arn}"
}
parallelism {
count = 1
}
schema {
record_columns {
mapping = "$.Description"
name = "Description"
sql_type = "VARCHAR(64)"
}
record_columns {
mapping = "$.StockCode"
name = "StockCode"
sql_type = "VARCHAR(10)"
}
record_columns {
mapping = "$.InvoiceNo"
name = "InvoiceNo"
sql_type = "INTEGER"
}
record_columns {
mapping = "$.InvoiceDate"
name = "InvoiceDate"
sql_type = "VARCHAR(32)"
}
record_columns {
mapping = "$.Quantity"
name = "Quantity"
sql_type = "INTEGER"
}
record_columns {
mapping = "$.UnitPrice"
name = "UnitPrice"
sql_type = "DECIMAL"
}
record_columns {
mapping = "$.Country"
name = "Country"
sql_type = "VARCHAR(64)"
}
record_columns {
mapping = "$.Customer"
name = "Customer"
sql_type = "VARCHAR(64)"
}
record_encoding = "UTF-8"
record_format {
mapping_parameters {
json {
record_row_path = "$"
}
}
}
}
}
outputs {
name = "TRIGGER_COUNT_STREAM"
kinesis_stream {
resource_arn = "${aws_kinesis_stream.OrderRateAlarms_kinesis_data_stream.arn}"
role_arn = "${aws_iam_role.kinesisanalytics_role.arn}"
}
schema {
record_format_type = "JSON"
}
}
}