Skip to content

Commit

Permalink
GitHub workflows (#1401)
Browse files Browse the repository at this point in the history
* Add WI for Workflows

* Add WI for Workflows

---------

Co-authored-by: Automatic Update <radix@statoilsrm.onmicrosoft.com>
  • Loading branch information
sveinpj and Automatic Update authored Jul 18, 2024
1 parent 80dfb38 commit 5915afc
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 4 deletions.
6 changes: 3 additions & 3 deletions terraform/subscriptions/modules/backupvaults/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ resource "azurerm_data_protection_backup_vault" "backupvault" {
###

resource "azurerm_data_protection_backup_policy_blob_storage" "policyblobstorage" {
name = var.policyblobstoragename
vault_id = azurerm_data_protection_backup_vault.backupvault.id
retention_duration = "P30D"
name = var.policyblobstoragename
vault_id = azurerm_data_protection_backup_vault.backupvault.id
operational_default_retention_duration = "P30D"
}

#######################################################################################
Expand Down
29 changes: 29 additions & 0 deletions terraform/subscriptions/s940/c2/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,35 @@ module "acr" {
dockercredentials_id = "/subscriptions/${module.config.subscription}/resourceGroups/${module.config.common_resource_group}/providers/Microsoft.ContainerRegistry/registries/radix${module.config.environment}cache/credentialSets/radix-service-account-docker"
}

module "radix-id-acr-workflows" {
source = "../../../modules/userassignedidentity"
name = "radix-id-acr-workflows-${module.config.environment}"
resource_group_name = module.config.common_resource_group
location = module.config.location
roleassignments = {
contributor = {
role = "Contributor" # Needed to open firewall
scope_id = module.acr.azurerm_container_registry_id
},
acrpush = {
role = "AcrPush"
scope_id = module.acr.azurerm_container_registry_id
}
}
federated_credentials = {
radix-acr-cleanup-release = {
name = "radix-acr-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-acr-cleanup:ref:refs/heads/release"
}
radix-cluster-cleanup-master = {
name = "radix-cluster-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-cluster-cleanup:ref:refs/heads/release"
},
}
}

output "workspace_id" {
value = module.loganalytics.workspace_id
}
Expand Down
29 changes: 29 additions & 0 deletions terraform/subscriptions/s940/prod/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,35 @@ module "acr" {
dockercredentials_id = "/subscriptions/${module.config.subscription}/resourceGroups/${module.config.common_resource_group}/providers/Microsoft.ContainerRegistry/registries/radix${module.config.environment}cache/credentialSets/radix-service-account-docker"
}

module "radix-id-acr-workflows" {
source = "../../../modules/userassignedidentity"
name = "radix-id-acr-workflows-${module.config.environment}"
resource_group_name = module.config.common_resource_group
location = module.config.location
roleassignments = {
contributor = {
role = "Contributor" # Needed to open firewall
scope_id = module.acr.azurerm_container_registry_id
},
acrpush = {
role = "AcrPush"
scope_id = module.acr.azurerm_container_registry_id
}
}
federated_credentials = {
radix-acr-cleanup-release = {
name = "radix-acr-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-acr-cleanup:ref:refs/heads/release"
}
radix-cluster-cleanup-master = {
name = "radix-cluster-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-cluster-cleanup:ref:refs/heads/release"
},
}
}

output "workspace_id" {
value = module.loganalytics.workspace_id
}
Expand Down
31 changes: 31 additions & 0 deletions terraform/subscriptions/s941/dev/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,40 @@ module "acr" {
vnet_resource_group = module.config.vnet_resource_group
subnet_id = data.azurerm_subnet.this.id
dockercredentials_id = "/subscriptions/${module.config.subscription}/resourceGroups/${module.config.common_resource_group}/providers/Microsoft.ContainerRegistry/registries/radix${module.config.environment}cache/credentialSets/radix-service-account-docker"
}

module "radix-id-acr-workflows" {
source = "../../../modules/userassignedidentity"
name = "radix-id-acr-workflows-${module.config.environment}"
resource_group_name = module.config.common_resource_group
location = module.config.location
roleassignments = {
contributor = {
role = "Contributor" # Needed to open firewall
scope_id = module.acr.azurerm_container_registry_id
},
acrpush = {
role = "AcrPush"
scope_id = module.acr.azurerm_container_registry_id
}
}
federated_credentials = {
radix-acr-cleanup-master = {
name = "radix-acr-cleanup-master"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-acr-cleanup:ref:refs/heads/master"
},
radix-cluster-cleanup-master = {
name = "radix-cluster-cleanup-master"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-cluster-cleanup:ref:refs/heads/master"
},
}

}



output "workspace_id" {
value = module.loganalytics.workspace_id
}
Expand Down
28 changes: 28 additions & 0 deletions terraform/subscriptions/s941/playground/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,35 @@ module "acr" {
vnet_resource_group = module.config.vnet_resource_group
subnet_id = data.azurerm_subnet.this.id
dockercredentials_id = "/subscriptions/${module.config.subscription}/resourceGroups/${module.config.common_resource_group}/providers/Microsoft.ContainerRegistry/registries/radix${module.config.environment}cache/credentialSets/radix-service-account-docker"
}

module "radix-id-acr-workflows" {
source = "../../../modules/userassignedidentity"
name = "radix-id-acr-workflows-${module.config.environment}"
resource_group_name = module.config.common_resource_group
location = module.config.location
roleassignments = {
contributor = {
role = "Contributor" # Needed to open firewall
scope_id = module.acr.azurerm_container_registry_id
},
acrpush = {
role = "AcrPush"
scope_id = module.acr.azurerm_container_registry_id
}
}
federated_credentials = {
radix-acr-cleanup-release = {
name = "radix-acr-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-acr-cleanup:ref:refs/heads/release"
}
radix-cluster-cleanup-master = {
name = "radix-cluster-cleanup-release"
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:equinor/radix-cluster-cleanup:ref:refs/heads/release"
},
}
}

#######################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module "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

}

data "azurerm_user_assigned_identity" "grafana" {
Expand Down

0 comments on commit 5915afc

Please sign in to comment.