-
-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathconfig.tf
49 lines (45 loc) · 1.01 KB
/
config.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
locals {
config-map-aws-auth = <<CONFIGMAPAWSAUTH
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: ${aws_iam_role.node.arn}
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
CONFIGMAPAWSAUTH
kubeconfig = <<KUBECONFIG
apiVersion: v1
clusters:
- cluster:
server: ${aws_eks_cluster.eks.endpoint}
certificate-authority-data: ${aws_eks_cluster.eks.certificate_authority.0.data}
name: ${var.cluster-name}
contexts:
- context:
cluster: ${var.cluster-name}
user: ${var.cluster-name}
name: ${var.cluster-name}
current-context: ${var.cluster-name}
kind: Config
preferences: {}
users:
- name: ${var.cluster-name}
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
command: aws
args:
- "eks"
- "get-token"
- "--cluster-name"
- "${var.cluster-name}"
- "--region"
- "${var.aws-region}"
KUBECONFIG
}