Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace azuread_group_members to use a secret #1547

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions terraform/subscriptions/s940/c2/common/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provider "azurerm" {
features {}
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
4 changes: 2 additions & 2 deletions terraform/subscriptions/s940/c2/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ module "radix-cr-cicd" {
source = "../../../modules/app_registration"
display_name = "radix-cr-cicd-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand All @@ -234,7 +234,7 @@ module "radix-cr-reader" {
source = "../../../modules/app_registration"
display_name = "radix-cr-reader-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand Down
6 changes: 3 additions & 3 deletions terraform/subscriptions/s940/c2/post-clusters/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ data "azurerm_role_definition" "this" {
name = "Omnia Authorization Locks Operator"
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
2 changes: 1 addition & 1 deletion terraform/subscriptions/s940/c2/post-clusters/grafana.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "grafana" {
notes = "Grafana Oauth, main app for user authentication to Grafana"
service_id = "110327"
web_uris = concat(["https://grafana.c2.radix.equinor.com/login/generic_oauth"], local.grafana_uris)
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
}

data "azurerm_user_assigned_identity" "grafana" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module "webconsole" {
service_id = "110327"
web_uris = local.web-uris
singlepage_uris = local.singlepage-uris
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
assignment_required = true

resource_access = {
Expand Down
5 changes: 5 additions & 0 deletions terraform/subscriptions/s940/extmon/post-clusters/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ module "clusters" {
resource_group_name = module.config.cluster_resource_group
subscription = module.config.subscription
}

data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
6 changes: 3 additions & 3 deletions terraform/subscriptions/s940/prod/common/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provider "azurerm" {
features {}
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
4 changes: 2 additions & 2 deletions terraform/subscriptions/s940/prod/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ module "radix-cr-cicd" {
source = "../../../modules/app_registration"
display_name = "radix-cr-cicd-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand All @@ -231,7 +231,7 @@ module "radix-cr-reader" {
source = "../../../modules/app_registration"
display_name = "radix-cr-reader-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand Down
6 changes: 3 additions & 3 deletions terraform/subscriptions/s940/prod/post-clusters/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data "azurerm_role_definition" "this" {
name = "Omnia Authorization Locks Operator"
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
2 changes: 1 addition & 1 deletion terraform/subscriptions/s940/prod/post-clusters/grafana.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "grafana" {
notes = "Grafana Oauth, main app for user authentication to Grafana"
service_id = "110327"
web_uris = concat(["https://grafana.radix.equinor.com/login/generic_oauth"], local.grafana_uris)
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
}

data "azurerm_user_assigned_identity" "grafana" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module "webconsole" {
service_id = "110327"
web_uris = local.web-uris
singlepage_uris = local.singlepage-uris
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
assignment_required = true

resource_access = {
Expand Down
6 changes: 3 additions & 3 deletions terraform/subscriptions/s941/dev/common/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provider "azurerm" {
features {}
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
4 changes: 2 additions & 2 deletions terraform/subscriptions/s941/dev/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ module "radix-cr-cicd" {
source = "../../../modules/app_registration"
display_name = "radix-cr-cicd-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand All @@ -236,7 +236,7 @@ module "radix-cr-reader" {
source = "../../../modules/app_registration"
display_name = "radix-cr-reader-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand Down
9 changes: 5 additions & 4 deletions terraform/subscriptions/s941/dev/post-clusters/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module "clusters" {
subscription = module.config.subscription
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
}
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}

2 changes: 1 addition & 1 deletion terraform/subscriptions/s941/dev/post-clusters/grafana.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "grafana" {
notes = "Grafana Oauth, main app for user authentication to Grafana"
service_id = "110327"
web_uris = concat(["https://grafana.${module.config.environment}.radix.equinor.com/login/generic_oauth"], local.grafana_uris)
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
}

data "azurerm_user_assigned_identity" "grafana" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "webconsole" {
service_id = "110327"
web_uris = local.web-uris
singlepage_uris = local.singlepage-uris
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
assignment_required = true

resource_access = {
Expand Down
6 changes: 3 additions & 3 deletions terraform/subscriptions/s941/playground/common/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provider "azurerm" {
features {}
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
4 changes: 2 additions & 2 deletions terraform/subscriptions/s941/playground/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ module "radix-cr-cicd" {
source = "../../../modules/app_registration"
display_name = "radix-cr-cicd-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand All @@ -227,7 +227,7 @@ module "radix-cr-reader" {
source = "../../../modules/app_registration"
display_name = "radix-cr-reader-${module.config.environment}"
service_id = "110327"
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
expose_API = true
implicit_grant = {
access_token_issuance_enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module "clusters" {
subscription = module.config.subscription
}

data "azuread_group" "radix" {
display_name = "Radix"
security_enabled = false
}
data "azurerm_key_vault_secret" "radixowners" {
name = "radixowners"
key_vault_id = module.config.backend.ip_key_vault_id
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "grafana" {
notes = "Grafana Oauth, main app for user authentication to Grafana"
service_id = "110327"
web_uris = concat(["https://grafana.${module.config.environment}.radix.equinor.com/login/generic_oauth"], local.grafana_uris)
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
}

data "azurerm_user_assigned_identity" "grafana" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module "webconsole" {
service_id = "110327"
web_uris = local.web-uris
singlepage_uris = local.singlepage-uris
owners = data.azuread_group.radix.members
owners = keys(jsondecode(data.azurerm_key_vault_secret.radixowners.value))
assignment_required = true

resource_access = {
Expand Down
Loading