-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
77 lines (59 loc) · 2.5 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
###############################################################################
# Providers
###############################################################################
# AWS provider configuration
provider "aws" {
region = local.region
}
# Kubernetes provider configuration
provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
}
}
# Helm provider configuration
provider "helm" {
kubernetes {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
}
}
}
###############################################################################
# Local variables
###############################################################################
locals {
#############################################################################
# General
#############################################################################
region = var.region
name = var.name
resource_tags = {
"Owner" = "${data.aws_caller_identity.current.user_id}"
"Project" = "${var.name}"
}
#############################################################################
# VPC
#############################################################################
azs = slice(data.aws_availability_zones.available.names, 0, length(data.aws_availability_zones.available.names))
#############################################################################
# AWS Cloud Map
#############################################################################
namespace_name = var.name
}
###############################################################################
# General data
###############################################################################
data "aws_caller_identity" "current" {}
###############################################################################
# VPC data
###############################################################################
data "aws_availability_zones" "available" {}