Skip to content

Commit

Permalink
fix: user management uses different project name
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Zieger committed Aug 24, 2024
1 parent ffb7031 commit 309e628
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
12 changes: 0 additions & 12 deletions azure/terraform/azure-devops/project/import-github-repo.tf

This file was deleted.

19 changes: 10 additions & 9 deletions azure/terraform/azure-devops/project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "random_pet" "suffix" {
length = 1
}

resource "azuredevops_project" "terraform_ado_project" {
resource "azuredevops_project" "devops_project" {
name = "${var.project_name}-${random_pet.suffix.id}"
description = var.description
visibility = var.visibility
Expand All @@ -19,7 +19,7 @@ resource "azuredevops_project" "terraform_ado_project" {
}

resource "azuredevops_serviceendpoint_github" "serviceendpoint_github" {
project_id = azuredevops_project.terraform_ado_project.id
project_id = azuredevops_project.devops_project.id
service_endpoint_name = "Sample GithHub Personal Access Token"

auth_personal {
Expand Down Expand Up @@ -65,31 +65,32 @@ locals {
}
# Assign Users to the specific Azure DevOps Groups
resource "azuredevops_group_membership" "admin_user_group_assignmnet" {
depends_on = [azuredevops_group.admin_group]
depends_on = [azuredevops_group.admin_group]

for_each = data.azuredevops_users.admin
group = azuredevops_group.admin_group.id
group = azuredevops_group.admin_group.id
members = [
tolist(each.value.users)[0].descriptor
]
}

resource "azuredevops_group_membership" "user_user_group_assignmnet" {
depends_on = [data.azuredevops_group.user_group]
depends_on = [data.azuredevops_group.user_group]

for_each = data.azuredevops_users.user
group = data.azuredevops_group.user_group.id
group = data.azuredevops_group.user_group.id
members = [
tolist(each.value.users)[0].descriptor
]
}

resource "azuredevops_group_membership" "reader_user_group_assignmnet" {
depends_on = [data.azuredevops_group.reader_group]
depends_on = [data.azuredevops_group.reader_group]

for_each = data.azuredevops_users.reader
group = data.azuredevops_group.reader_group.id
group = data.azuredevops_group.reader_group.id
members = [
tolist(each.value.users)[0].descriptor
]
}
}

4 changes: 2 additions & 2 deletions azure/terraform/azure-devops/project/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
output "Project_ID" {
value = azuredevops_project.terraform_ado_project.id
value = azuredevops_project.devops_project.id
}

output "process_template_id" {
value = azuredevops_project.terraform_ado_project.process_template_id
value = azuredevops_project.devops_project.process_template_id
}

0 comments on commit 309e628

Please sign in to comment.