forked from 13scoobie/snowplow-terraform-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
74 lines (62 loc) · 2.35 KB
/
main.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
# Build necessary IAM roles
module "snowplow-users" { source = "iam-users" }
# Set up Kinesis Streams
module "analytics-good" {
source = "kinesis-stream"
name = "AnalyticsCollector-Good"
}
module "analytics-bad" {
source = "kinesis-stream"
name = "AnalyticsCollector-Bad"
}
module "analytics-enrich-good" {
source = "kinesis-stream"
name = "AnalyticsEnriched-Good"
}
module "analytics-enrich-bad" {
source = "kinesis-stream"
name = "AnalyticsEnriched-Bad"
}
module "analytics-load-bad" {
source = "kinesis-stream"
name = "AnalyticsLoad-Bad"
}
# Get local machine's IP
data "http" "my-ip" {
url = "http://icanhazip.com"
}
module "snowplow-collector" {
source = "1-snowplow-collector"
aws_region = "${var.aws_region}"
machine_ip = "${data.http.my-ip.body}"
key_pair_name = "${var.key_pair_name}"
key_pair_loc = "${var.key_pair_location}"
operator_access_key = "${module.snowplow-users.operator-access-key}"
operator_secret_key = "${module.snowplow-users.operator-secret-key}"
good_stream_name = "${module.analytics-good.stream-name}"
bad_stream_name = "${module.analytics-bad.stream-name}"
ssl_acm_arn = "${var.ssl_acm_arn}"
}
module "snowplow-enrich" {
source = "2-snowplow-enrich"
aws_region = "${var.aws_region}"
machine_ip = "${data.http.my-ip.body}"
key_pair_name = "${var.key_pair_name}"
key_pair_loc = "${var.key_pair_location}"
operator_access_key = "${module.snowplow-users.operator-access-key}"
operator_secret_key = "${module.snowplow-users.operator-secret-key}"
stream_in = "${module.analytics-good.stream-name}"
good_stream_out = "${module.analytics-enrich-good.stream-name}"
bad_stream_out = "${module.analytics-enrich-bad.stream-name}"
}
module "snowplow-loader" {
source = "3-snowplow-elasticsearch-loader"
aws_region = "${var.aws_region}"
machine_ip = "${data.http.my-ip.body}"
key_pair_name = "${var.key_pair_name}"
key_pair_loc = "${var.key_pair_location}"
operator_access_key = "${module.snowplow-users.operator-access-key}"
operator_secret_key = "${module.snowplow-users.operator-secret-key}"
stream_in = "${module.analytics-enrich-good.stream-name}"
bad_stream_out = "${module.analytics-load-bad.stream-name}"
}