From 5d9335cedb12447a4496aeb95418b2ed6f87f60d Mon Sep 17 00:00:00 2001 From: Dipti Pai Date: Fri, 19 Jul 2024 13:42:00 -0700 Subject: [PATCH 1/2] Add project_id to devops TF output Signed-off-by: Dipti Pai --- tf-modules/azure/devops/outputs.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tf-modules/azure/devops/outputs.tf b/tf-modules/azure/devops/outputs.tf index f6f514b..e2887e6 100644 --- a/tf-modules/azure/devops/outputs.tf +++ b/tf-modules/azure/devops/outputs.tf @@ -1,4 +1,9 @@ output "repo_url" { description = "Azure Devops Git repository HTTPS url" value = azuredevops_git_repository.application.remote_url +} + +output "project_id" { + description = "Azure Devops Project ID" + value = azuredevops_project.project.id } \ No newline at end of file From 365b59d4995c73195db081b531a4aa0dda707546 Mon Sep 17 00:00:00 2001 From: Dipti Pai Date: Tue, 30 Jul 2024 14:30:13 -0700 Subject: [PATCH 2/2] Format the terraform files, use latest versions and remove tags Signed-off-by: Dipti Pai --- tf-modules/azure/devops/main.tf | 16 +++++----------- tf-modules/azure/devops/outputs.tf | 10 +++++----- tf-modules/azure/devops/variables.tf | 12 ++++++------ tf-modules/azure/devops/versions.tf | 6 ++---- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/tf-modules/azure/devops/main.tf b/tf-modules/azure/devops/main.tf index 16fa098..162043a 100644 --- a/tf-modules/azure/devops/main.tf +++ b/tf-modules/azure/devops/main.tf @@ -1,11 +1,5 @@ -module "tags" { - source = "git::https://github.com/fluxcd/test-infra.git//tf-modules/utils/tags" - - tags = var.tags -} - provider "azuredevops" { - org_service_url = "https://dev.azure.com/${var.organization}" + org_service_url = "https://dev.azure.com/${var.organization}" personal_access_token = var.pat_token } @@ -14,14 +8,14 @@ resource "azuredevops_project" "project" { visibility = "private" version_control = "Git" work_item_template = "Agile" - description = "Test Project for Flux E2E test - Managed by Terraform" + description = var.project_description } resource "azuredevops_git_repository" "application" { - project_id = azuredevops_project.project.id - name = var.repository_name + project_id = azuredevops_project.project.id + name = var.repository_name default_branch = "refs/heads/main" initialization { init_type = "Clean" } -} \ No newline at end of file +} diff --git a/tf-modules/azure/devops/outputs.tf b/tf-modules/azure/devops/outputs.tf index e2887e6..6801fcd 100644 --- a/tf-modules/azure/devops/outputs.tf +++ b/tf-modules/azure/devops/outputs.tf @@ -1,9 +1,9 @@ output "repo_url" { - description = "Azure Devops Git repository HTTPS url" - value = azuredevops_git_repository.application.remote_url + description = "Azure Devops Git repository HTTPS url" + value = azuredevops_git_repository.application.remote_url } output "project_id" { - description = "Azure Devops Project ID" - value = azuredevops_project.project.id -} \ No newline at end of file + description = "Azure Devops Project ID" + value = azuredevops_project.project.id +} diff --git a/tf-modules/azure/devops/variables.tf b/tf-modules/azure/devops/variables.tf index a33927d..28fd20b 100644 --- a/tf-modules/azure/devops/variables.tf +++ b/tf-modules/azure/devops/variables.tf @@ -13,13 +13,13 @@ variable "project_name" { type = string } +variable "project_description" { + description = "The description of the Azure DevOps project" + type = string + default = "Test Project for Flux E2E test - Managed by Terraform" +} + variable "repository_name" { description = "The name of the Azure DevOps repository" type = string } - -variable "tags" { - description = "Tags for the created resources" - type = map(string) - default = {} -} \ No newline at end of file diff --git a/tf-modules/azure/devops/versions.tf b/tf-modules/azure/devops/versions.tf index 6c0d518..03d5ac9 100644 --- a/tf-modules/azure/devops/versions.tf +++ b/tf-modules/azure/devops/versions.tf @@ -1,10 +1,8 @@ terraform { - required_version = ">= 0.12" - required_providers { azuredevops = { source = "microsoft/azuredevops" - version = ">= 0.1.0" + version = ">= 1.2.0" } } -} \ No newline at end of file +}