-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheks_userlist.tf
35 lines (32 loc) · 1.16 KB
/
eks_userlist.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
resource "kubernetes_config_map_v1_data" "users_list_testnet" {
provider = kubernetes.k8s_cluster_testnet
metadata {
name = "aws-auth"
namespace = "kube-system"
}
data = {
"mapUsers" = templatefile("${path.module}/configs/user_management/eks_users_list.yaml", {
aws_account_id = data.aws_caller_identity.current.account_id,
get_users = {for user in local.users : user.username => lookup(user.eks_access, local.eks_cluster_testnet,"")
if contains(keys(lookup(user, "eks_access", [])), local.eks_cluster_testnet)
}
})
}
force = true
}
resource "kubernetes_config_map_v1_data" "users_list_mainnet" {
provider = kubernetes.k8s_cluster_mainnet
metadata {
name = "aws-auth"
namespace = "kube-system"
}
data = {
"mapUsers" = templatefile("${path.module}/configs/user_management/eks_users_list.yaml", {
aws_account_id = data.aws_caller_identity.current.account_id,
get_users = {for user in local.users : user.username => lookup(user.eks_access, local.eks_cluster_mainnet,"")
if contains(keys(lookup(user, "eks_access", [])), local.eks_cluster_mainnet)
}
})
}
force = true
}