-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
66 lines (58 loc) · 1.88 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
module "jenkins_main-asg" {
source = "./modules/jenkins_main-asg"
repo-name = var.repo-name
subnet_id = module.networking.vpc.public_subnets[0]
security_group = [module.networking.jenkins-sg.id]
key_name = module.key_gen.key_info.public_key_openssh
image_id = module.aws_data.ami.id
}
module "networking" {
source = "./modules/vpc"
repo-name = var.repo-name
azs = module.aws_data.az_names.names
}
module "key_gen" {
source = "./modules/aws_keys"
repo-name = var.repo-name
random_number = module.aws_data.random_number.result
}
### Not Removing bc I might want it later ###
/*module "elastic-load-balancer" {
source = "./modules/load-balancer"
repo-name = var.repo-name
security_group = [module.networking.jenkins-sg.id]
subnet_id = [module.networking.vpc.public_subnets[0], module.networking.vpc.public_subnets[1]]
vpc = module.networking.vpc.vpc_id
}*/
module "jenkins_node-asg" {
source = "./modules/jenkins_nodes-asg"
repo-name = var.repo-name
subnet_id = module.networking.vpc.public_subnets[0]
security_group = [module.networking.jenkins-sg.id, module.networking.jenkins-ssh-sg.id]
key_name = module.key_gen.key_info.public_key_openssh
image_id = module.aws_data.ami.id
}
module "aws_data" {
source = "./modules/aws_data"
}
module "iam_module" {
source = "./modules/iam"
identifer = module.aws_data.random_number.result
repo-name = var.repo-name
}
/*
module "s3_storage" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "${var.repo-name}-backend-${module.aws_data.random_number.result}"
versioning = {
enabled = true
}
server_side_encryption_configuration = {
rule = {
apply_server_side_encryption_by_default = {
kms_master_key_id = "${module.key_gen.s3_key.id}"
sse_algorithm = "aws:kms"
}
}
}
}*/