diff --git a/azure/terraform/azure-devops/project/import-github-repo.tf b/azure/terraform/azure-devops/project/import-github-repo.tf deleted file mode 100644 index 1f2f7f7..0000000 --- a/azure/terraform/azure-devops/project/import-github-repo.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Note that this example should import the GitHub Repo for this code into Azure DevOps. However, it appears as though this is still not fully supported. -# Also at this time only public repos are supported for import. -# -#resource "azuredevops_git_repository" "imported_repo" { -# project_id = azuredevops_project.terraform_ado_project.id -# name = "Imported Repo" -# initialization { -# init_type = "Import" -# source_type = "Git" -# source_url = "xxxxxxxxxxxxxxxxxxxx -# } -#} \ No newline at end of file diff --git a/azure/terraform/azure-devops/project/main.tf b/azure/terraform/azure-devops/project/main.tf index 1ee2598..cb2b012 100644 --- a/azure/terraform/azure-devops/project/main.tf +++ b/azure/terraform/azure-devops/project/main.tf @@ -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 @@ -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 { @@ -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 ] -} \ No newline at end of file +} + diff --git a/azure/terraform/azure-devops/project/outputs.tf b/azure/terraform/azure-devops/project/outputs.tf index 74239b6..a49ef78 100644 --- a/azure/terraform/azure-devops/project/outputs.tf +++ b/azure/terraform/azure-devops/project/outputs.tf @@ -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 }