-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmain.tf
124 lines (101 loc) · 3.02 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
variable "common_tags" {
type = map(string)
default = {
builtWith = "terraform"
terraformGroup = "training-dmx"
}
}
resource "aws_key_pair" "deployer" {
key_name = "training-dmx"
public_key = file("deployer-key.pub")
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.1.2"
name = "training-vpc"
tags = var.common_tags
azs = var.aws_availability_zones
cidr = "10.200.0.0/16"
private_subnets = ["10.200.1.0/24"]
public_subnets = ["10.200.101.0/24"]
enable_nat_gateway = "true"
single_nat_gateway = "false"
enable_dns_hostnames = "true"
enable_dns_support = "true"
}
module "vpc_endpoints" {
source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints"
version = "5.1.2"
vpc_id = module.vpc.vpc_id
create_security_group = true
security_group_name_prefix = "training-vpc-endpoints-"
security_group_description = "VPC endpoint security group"
security_group_rules = {
ingress_https = {
description = "HTTPS from VPC"
cidr_blocks = [module.vpc.vpc_cidr_block]
}
}
endpoints = {
s3 = {
service = "s3"
service_type = "Gateway"
route_table_ids = module.vpc.private_route_table_ids
tags = var.common_tags
}
}
tags = var.common_tags
}
module "emr" {
source = "./emr"
tags = var.common_tags
# Configuration: Set the cluster names
names = ["kku"]
#names = ["cl1","kku"]
# Configuration: Set the desired EMR release
release = "emr-6.13.0"
# Configuration: Set the desired EMR components
applications = ["Spark","Hadoop","Hue","Zeppelin","Hive","Zookeeper"]
# Configuration: Set the desired EC2 instance type for the master
# Refer to https://aws.amazon.com/de/ec2/spot/pricing/ for spot pricing
master_type = "m5.xlarge"
master_ebs_size = "60"
master_bid_price = "" # 0.30
# Configuration: Set the desired EC2 instance type for the workers
worker_type = "m5.xlarge"
worker_ebs_size = "120"
worker_bid_price = "" # 0.60
worker_count = 1
# Setup logging
log_uri = "s3://dimajix-logs/training/emr"
vpc_id = module.vpc.vpc_id
subnet_id = module.vpc.private_subnets[0]
edge_security_group_id = module.proxy.security_group_id
ssh_key_ids = [aws_key_pair.deployer.id]
}
module "proxy" {
source = "./proxy"
tags = var.common_tags
names = module.emr.names
public_masters = module.emr.master_public_dns
private_masters = module.emr.master_private_dns
# Configure the domain
proxy_domain = "training.dimajix-aws.net"
# Configuration: Set the user name for basic auth
proxy_user = "destatis"
# Configuration: Set the password for basic auth
proxy_password = "dmx2023"
vpc_id = module.vpc.vpc_id
subnet_id = module.vpc.public_subnets[0]
ssh_key_id = aws_key_pair.deployer.id
ssh_key = file("deployer-key")
ssl_certs = "certs"
}
module "route53" {
source = "./route53"
tags = var.common_tags
names = module.emr.names
targets = [module.proxy.public_dns]
# Configuration: Set the Route53 zone to use
zone_name = "training.dimajix-aws.net"
}