Russell Maycock
Russell Maycock

Reputation: 29

Azure pipelines and terraform modules in a azure repo

I’ve setup azure pipelines with terraform files and in the files, I reference two modules which are contained in a separate repo in a separate project.

To call the modules

module "Webapp" {

source = "git::https://[email protected]/organisationname/Infrastructure/_git/Modules//Webapp"
resource_group_name = azurerm_resource_group.service.name
location            = azurerm_resource_group.service.location

it all works but I have a couple of questions I can’t answer. In the artifact file, I expected to see just the module files under the Webapp folder (in the modules folder) but instead, I have the whole of the repo and in the second module I have the same, another copy of the whole repo. The modules still work as they point to the WebApp folder of the repo structure.

I’ve included a couple of pics, the one shows the module repo, which contains my folders for each module. and the second is a pic of the artifact and as you can see the whole of the repo is copy twice in to each of the module directories.

Why is this happening? and how do I just download the folder of the module rather than the whole module? enter image description here

enter image description here

Upvotes: 0

Views: 1301

Answers (1)

Hugh Lin
Hugh Lin

Reputation: 19391

I tested with a terraform module repo and generated an artifact in the build pipeline , the module folder is normal in artifact and does not copy the entire repo. In your case, I think this could be that you performed some special operation on source . You can check and share your build definition and sample terraform.

enter image description hereenter image description here

how do I just download the folder of the module rather than the whole module

For this issue , You can click the download button behind the module folder to download the specified module artifact you want.

enter image description here

Upvotes: 1

Related Questions