File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ variable "rbac_group_oidc_claim" {
2121 default = " terraform_organization_name"
2222}
2323
24- variable "rbac_admin_group_name " {
24+ variable "rbac_oidc_group_name " {
2525 type = string
2626}
2727
@@ -69,6 +69,6 @@ resource "kubernetes_cluster_role_binding_v1" "oidc_role" {
6969 subject {
7070 api_group = " rbac.authorization.k8s.io"
7171 kind = " Group"
72- name = var. rbac_admin_group_name
72+ name = var. rbac_oidc_group_name
7373 }
7474}
Original file line number Diff line number Diff line change @@ -33,11 +33,29 @@ resource "kubernetes_manifest" "oidc_conf" {
3333 clientID = var.oidc_audience
3434 issuerURI = var.odic_issuer_uri
3535 userClaim = var.oidc_user_claim
36- groupClaim = var.oidc_group_claim
36+ groupsClaim = var.oidc_group_claim
3737 certificateAuthorityData = var.TFE_CA_cert
3838 }
3939 }
4040 ]
4141 }
4242 }
4343}
44+
45+ resource "kubernetes_cluster_role_binding_v1" "oidc_role" {
46+ metadata {
47+ name = " odic-identity"
48+ }
49+
50+ role_ref {
51+ api_group = " rbac.authorization.k8s.io"
52+ kind = " ClusterRole"
53+ name = var. rbac_group_cluster_role
54+ }
55+
56+ subject {
57+ api_group = " rbac.authorization.k8s.io"
58+ kind = " Group"
59+ name = var. rbac_oidc_group_name
60+ }
61+ }
Original file line number Diff line number Diff line change @@ -40,3 +40,13 @@ variable "TFE_CA_cert" {
4040 type = string
4141 default = null
4242}
43+
44+ variable "rbac_oidc_group_name" {
45+ description = " Name of OIDC group (according to 'oidc_group_claim') to be granted the role designated by 'var.rbac_group_cluster_role'"
46+ type = string
47+ }
48+
49+ variable "rbac_group_cluster_role" {
50+ description = " Kubernetes role to be bound to the OIDC group designated by 'var.rbac_oidc_group_name'"
51+ default = " cluster-admin"
52+ }
You can’t perform that action at this time.
0 commit comments