Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
Created February 7, 2022 17:31
Show Gist options
  • Save dallasmarlow/ab8c38d8e2ab2b7c18d291b5ed4f19a8 to your computer and use it in GitHub Desktop.
Save dallasmarlow/ab8c38d8e2ab2b7c18d291b5ed4f19a8 to your computer and use it in GitHub Desktop.
eks-web-console-group.tf
resource "kubernetes_manifest" "eks_console_role" {
manifest = {
apiVersion = "rbac.authorization.k8s.io/v1"
kind = "ClusterRole"
metadata = {
name = "eks-console"
}
rules = [
{
"apiGroups" = [
"",
]
"resources" = [
"namespaces",
"nodes",
"pods",
]
"verbs" = [
"get",
"list",
]
},
{
"apiGroups" = [
"apps",
]
"resources" = [
"daemonsets",
"deployments",
"replicasets",
"statefulsets",
]
"verbs" = [
"get",
"list",
]
},
{
"apiGroups" = [
"batch",
]
"resources" = [
"jobs",
]
"verbs" = [
"get",
"list",
]
}
]
}
}
resource "kubernetes_manifest" "eks_console_role_binding" {
depends_on = [
kubernetes_manifest.eks_console_role,
]
manifest = {
apiVersion = "rbac.authorization.k8s.io/v1"
kind = "ClusterRoleBinding"
metadata = {
name = "eks-console"
}
roleRef = {
"apiGroup" = "rbac.authorization.k8s.io"
"kind" = "ClusterRole"
"name" = "eks-console"
}
subjects = [
{
"apiGroup" = "rbac.authorization.k8s.io"
"kind" = "Group"
"name" = "eks-console"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment