-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
main.tf
79 lines (64 loc) · 3.15 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
provider "aws" {
region = var.region
}
module "vpc" {
source = "cloudposse/vpc/aws"
version = "1.1.0"
ipv4_primary_cidr_block = "172.19.0.0/16"
context = module.this.context
}
module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "2.0.2"
availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
nat_gateway_enabled = false
nat_instance_enabled = false
context = module.this.context
}
module "s3_log_storage" {
source = "cloudposse/s3-log-storage/aws"
version = "0.26.0"
force_destroy = true
attributes = ["logs"]
context = module.this.context
}
module "aws_key_pair" {
source = "cloudposse/key-pair/aws"
version = "0.18.3"
ssh_public_key_path = var.ssh_public_key_path
generate_ssh_key = var.generate_ssh_key
attributes = ["ssh", "key"]
context = module.this.context
}
module "emr_cluster" {
source = "../../"
master_allowed_security_groups = [module.vpc.vpc_default_security_group_id]
slave_allowed_security_groups = [module.vpc.vpc_default_security_group_id]
region = var.region
vpc_id = module.vpc.vpc_id
subnet_id = module.this.enabled ? module.subnets.private_subnet_ids[0] : null
route_table_id = module.this.enabled ? module.subnets.private_route_table_ids[0] : null
subnet_type = "private"
ebs_root_volume_size = var.ebs_root_volume_size
visible_to_all_users = var.visible_to_all_users
release_label = var.release_label
applications = var.applications
configurations_json = var.configurations_json
core_instance_group_instance_type = var.core_instance_group_instance_type
core_instance_group_instance_count = var.core_instance_group_instance_count
core_instance_group_ebs_size = var.core_instance_group_ebs_size
core_instance_group_ebs_type = var.core_instance_group_ebs_type
core_instance_group_ebs_volumes_per_instance = var.core_instance_group_ebs_volumes_per_instance
master_instance_group_instance_type = var.master_instance_group_instance_type
master_instance_group_instance_count = var.master_instance_group_instance_count
master_instance_group_ebs_size = var.master_instance_group_ebs_size
master_instance_group_ebs_type = var.master_instance_group_ebs_type
master_instance_group_ebs_volumes_per_instance = var.master_instance_group_ebs_volumes_per_instance
create_task_instance_group = var.create_task_instance_group
log_uri = format("s3://%s/", module.s3_log_storage.bucket_id)
key_name = module.aws_key_pair.key_name
context = module.this.context
}