0
votes

Trying to source a terraform module from a git repo in Azure DevOps.

This works, and pulls the code from the master branch

module "my_module" {

      source ="git::https://dev.azure.com/company/project/_git/MyModules//module1"

    }

This doesn't work, and instead redirects me to the webpage.

    module "my_module" {

      source ="git::https://dev.azure.com/company/project/_git/MyModules//module1?ref=GT1.0"

    }
1

1 Answers

0
votes

I import a public repo https://github.com/terraform-aws-modules/terraform-aws-ecs.git into Azure DevOps Git

module "ecs" {
  source = "git::https://dev.azure.com/xxxxxxxx/terraform-aws-ecs/_git/terraform-aws-ecs?ref=v1.0.0"

  name = "my-ecs"
}

I can get the package without issue

$ terraform get
- module.ecs
  Getting source "git::https://dev.azure.com/xxxxxxxx/terraform-aws-ecs/_git/terraform-aws-ecs?ref=v1.0.0"