microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
107 stars 66 forks source link

Terraform errors on reading the source git repo: includes (MISSING) #93

Closed fasongan closed 1 year ago

fasongan commented 2 years ago

terraform { source = "git::ssh://WinshuttleEngineering@vs-ssh.visualstudio.com/v3/WinshuttleEngineering/Hosted%20Multi-Tenant/mtsm-infrastructure.git//source-control/azure-repo?ref=feature/mtsm-management" }

this code errors on downloading the repo as error seen below:

[INFO] TGENV_VERSION is 0.38.3 time=2022-10-18T20:26:03Z level=error msg=1 error occurred:

tried this source : "git::ssh://WinshuttleEngineering@vs-ssh.visualstudio.com:v3/WinshuttleEngineering/Hosted%20Multi-Tenant/mtsm-infrastructure.git//source-control/azure-repo?ref=feature/mtsm-management" and this source: "//WinshuttleEngineering@vs-ssh.visualstudio.com:v3/WinshuttleEngineering/Hosted%20Multi-Tenant/mtsm-infrastructure.git//source-control/azure-repo?ref=feature/mtsm-management"

but to no avai.

Please any suggestions ?

AminTi commented 2 years ago

 Thanks for reporting, we'll dig into this

mericstam commented 2 years ago

Please provide more information, like: Are you using classic or yaml pipelines? if you are using classic please provide som screenshots of your pipeline. if you are using YAML pipelines please provide the yaml code. Where does the error appear? like during init, plan, ETC Which version of the task are you using?

fasongan commented 2 years ago

Im using yaml pipeline

my error occurs during the terraform plan by running this terragrunt file

locals { project_id = read_terragrunt_config(find_in_parent_folders( "project.hcl"))["locals"]["project_id"] customer = read_terragrunt_config(find_in_parent_folders( "customer.hcl"))["locals"]["customer"] azure_repo_name = read_terragrunt_config(find_in_parent_folders( "naming.hcl"))["locals"]["azure_repo_name"] }

terraform { source = "git::ssh:// @.***/v3/WinshuttleEngineering/Hosted%20Multi-Tenant/mtsm-infrastructure.git//source-control/azure-repo?ref=feature/mtsm-management " }

Include all settings from the root terragrunt.hcl file

include { path = find_in_parent_folders( "root-terragrunt-feature-mtsm-management.hcl") }

inputs = { name = local.azure_repo_name project_id = local.project_id initial_files = [{ file = "readme.md" content = <<EOF

${local.azure_repo_name}

Tracks server configuration files for customer ${local.customer} EOF commit_message = "Initial readme commit" }] }

Heres the error (uploaded)

1. run command: terragrunt plan [INFO] Getting version from tgenv-version-name [INFO] TGENV_VERSION is 0.38.3 time=2022-10-18T21:38:41Z level=error msg=1 error occurred:

On Wed, Oct 19, 2022 at 10:38 AM mericstam @.***> wrote:

Please provide more information, like: Are you using classic or yaml pipelines? if you are using classic please provide som screenshots of your pipeline. if you are using YAML pipelines please provide the yaml code. Where does the error appear? like during init, plan, ETC Which version of the task are you using?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/azure-pipelines-terraform/issues/93#issuecomment-1284212195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3HYOMMSWU6MPNKPOWIGKTWEAIWVANCNFSM6AAAAAARIOR4UI . You are receiving this because you authored the thread.Message ID: @.***>

-- Fontem Asonganyi

Linux Systems Engineer RHCSA RHCI

mericstam commented 2 years ago

if you are using YAML pipelines I would like to see the yaml code to be able to assist.

fasongan commented 2 years ago

ok so heres the azure module in using resource "azuredevops_git_repository" "repo" { project_id = var.project_id name = var.name default_branch = "refs/heads/main" initialization { init_type = "Clean" } }

resource "azuredevops_git_repository_file" "readme" { for_each = { for file in var.initial_files : file.file => file }

repository_id = azuredevops_git_repository.repo.id file = each.value.file content = each.value.content branch = "refs/heads/main" commit_message = each.value.commit_message overwrite_on_create = true }

Heres the pipeline im running a terragrunt file and wrapping the module up for terragrunt to run it [image: image.png]

On Wed, Oct 19, 2022 at 2:12 PM mericstam @.***> wrote:

if you are using YAML pipelines I would like to see the yaml code to be able to assist.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/azure-pipelines-terraform/issues/93#issuecomment-1284457890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3HYOKKENS4RZ4KHW7GA2LWEBBYHANCNFSM6AAAAAARIOR4UI . You are receiving this because you authored the thread.Message ID: @.***>

I sent you the terragrunt file before. the pipeline runs on modules so im guessing its running classic

-- Fontem Asonganyi

Linux Systems Engineer RHCSA RHCI

mericstam commented 2 years ago

Hi, You need to answer the issue directly on GitHub because the images are not included if you reply via email.

mericstam commented 1 year ago

Closing this due to inactivity.