Skip to content

Commit

Permalink
Format the terraform files, use latest versions and remove tags
Browse files Browse the repository at this point in the history
Signed-off-by: Dipti Pai <[email protected]>
  • Loading branch information
dipti-pai committed Jul 30, 2024
1 parent beb7933 commit ec0e1bc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
16 changes: 5 additions & 11 deletions tf-modules/azure/devops/main.tf
Original file line number Diff line number Diff line change
@@ -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
}

Expand All @@ -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"
}
}
}
10 changes: 5 additions & 5 deletions tf-modules/azure/devops/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
description = "Azure Devops Project ID"
value = azuredevops_project.project.id
}
12 changes: 6 additions & 6 deletions tf-modules/azure/devops/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}
6 changes: 2 additions & 4 deletions tf-modules/azure/devops/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
terraform {
required_version = ">= 0.12"

required_providers {
azuredevops = {
source = "microsoft/azuredevops"
version = ">= 0.1.0"
version = ">= 1.2.0"
}
}
}
}

0 comments on commit ec0e1bc

Please sign in to comment.