-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
49 lines (42 loc) · 1.31 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
### Data sources ###
data "aws_availability_zones" "available" {
state = "available"
}
data "aws_caller_identity" "current" {}
### Kubernetes provider configuration
data "aws_eks_cluster_auth" "eks" {
name = module.eks.cluster_name
}
provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks.token
}
### Helm provider configuration
provider "helm" {
kubernetes {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks.token
}
}
#### Platform module
module "platform" {
count = var.platform.enabled ? 1 : 0
source = "./platform"
allowed_clients_cidrs = var.allowed_clients_cidrs
public_dns_zone = var.public_dns_zone
eks = module.eks
region = var.region
acme_email = var.acme_email
account_id = local.account_id
}
#### Apps module
module "apps" {
count = var.apps.enabled ? 1 : 0
source = "./apps"
public_dns_zone = var.public_dns_zone
depends_on = [
module.platform
]
}