forked from w3f/terraform-aws-polkadot-deployer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
outputs.tf
55 lines (52 loc) · 1.21 KB
/
outputs.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
locals {
config_map_aws_auth = <<CONFIGMAPAWSAUTH
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: ${aws_iam_role.polkadot-eks-node.arn}
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
CONFIGMAPAWSAUTH
kubeconfig = <<KUBECONFIG
apiVersion: v1
clusters:
- cluster:
server: ${aws_eks_cluster.polkadot.endpoint}
certificate-authority-data: ${aws_eks_cluster.polkadot.certificate_authority.0.data}
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: aws
name: aws
current-context: aws
kind: Config
preferences: {}
users:
- name: aws
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
command: aws-iam-authenticator
args:
- "token"
- "-i"
- "${var.cluster_name}"
KUBECONFIG
}
output "config_map_aws_auth" {
description = "A kubernetes configuration to authenticate to this EKS cluster"
value = "${local.config_map_aws_auth}"
sensitive = true
}
output "kubeconfig" {
description = "kubectl config file contents for this EKS cluster"
value = "${local.kubeconfig}"
sensitive = true
}