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

feat: new identity oidc for fdr #2782

Merged
merged 3 commits into from
Feb 11, 2025
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
30 changes: 30 additions & 0 deletions src/domains/fdr-common/10_github_identity.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ locals {
}
]

federations_01_oidc = [
for repo in local.repos_01 : {
repository = repo
subject = "oidc"
}
]

environment_cd_roles = {
subscription = [
"Contributor"
Expand Down Expand Up @@ -103,6 +110,29 @@ module "identity_ci_01" {
]
}

# create a module for each 20 repos
module "identity_oidc_01" {
source = "github.com/pagopa/terraform-azurerm-v3//github_federated_identity?ref=v8.36.1"
prefix = var.prefix
env_short = var.env_short
domain = "${var.domain}-01-oidc"

identity_role = "cd"

github_federations = local.federations_01_oidc

cd_rbac_roles = {
subscription_roles = local.environment_cd_roles.subscription
resource_groups = local.environment_cd_roles.resource_groups
}

tags = var.tags

depends_on = [
data.azurerm_resource_group.identity_rg
]
}

resource "null_resource" "github_runner_app_permissions_to_namespace_cd_01" {
triggers = {
aks_id = data.azurerm_kubernetes_cluster.aks.id
Expand Down
Loading
Loading