-
Notifications
You must be signed in to change notification settings - Fork 320
/
Copy pathmain.tf
63 lines (47 loc) · 1.8 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
locals {
security_groups_active = !var.opentelemetry_enabled
}
module "tags" {
source = "../../lib/tags"
environment_name = var.environment_name
}
module "vpc" {
source = "../../lib/vpc"
environment_name = var.environment_name
public_subnet_tags = {
"kubernetes.io/cluster/${var.environment_name}" = "shared"
"kubernetes.io/role/elb" = 1
}
private_subnet_tags = {
"kubernetes.io/cluster/${var.environment_name}" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
tags = module.tags.result
}
module "dependencies" {
source = "../../lib/dependencies"
environment_name = var.environment_name
tags = module.tags.result
vpc_id = module.vpc.inner.vpc_id
subnet_ids = module.vpc.inner.private_subnets
availability_zones = module.vpc.inner.azs
catalog_security_group_id = local.security_groups_active ? aws_security_group.catalog.id : module.retail_app_eks.node_security_group_id
orders_security_group_id = local.security_groups_active ? aws_security_group.orders.id : module.retail_app_eks.node_security_group_id
checkout_security_group_id = local.security_groups_active ? aws_security_group.checkout.id : module.retail_app_eks.node_security_group_id
}
module "retail_app_eks" {
source = "../../lib/eks"
providers = {
kubernetes.cluster = kubernetes.cluster
kubernetes.addons = kubernetes
helm = helm
}
environment_name = var.environment_name
cluster_version = "1.30"
vpc_id = module.vpc.inner.vpc_id
vpc_cidr = module.vpc.inner.vpc_cidr_block
subnet_ids = module.vpc.inner.private_subnets
opentelemetry_enabled = var.opentelemetry_enabled
tags = module.tags.result
istio_enabled = var.istio_enabled
}