Azure / terraform-azurerm-avm-res-managedidentity-userassignedidentity

To gain access, please finish setting up this repository now at:
https://repos.opensource.microsoft.com/Azure/wizard?existingreponame=terraform-azurerm-avm-res-managedidentity-userassignedidentity&existingrepoid=764827718
MIT License
4 stars 5 forks source link

[AVM Module Issue]: Cannot specify module version #49

Closed Dipak-Mistry-WTW closed 2 months ago

Dipak-Mistry-WTW commented 2 months ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.3.1 or 0.3.2

(Optional) Correlation Id

No response

Description

If I want to lock down the version of the module I get the following error:

Could not download module "uami_apac" (main.tf:48) source code from
│ "git::https://github.com/Azure/terraform-azurerm-avm-res-managedidentity-userassignedidentity.git?ref=v0.3.1": error downloading
│ 'https://github.com/Azure/terraform-azurerm-avm-res-managedidentity-userassignedidentity.git?ref=v0.3.1': C:\Program Files\Git\cmd\git.exe exited with 1:
│ error: pathspec 'v0.3.1' did not match any file(s) known to git
JFolberth commented 2 months ago

@Dipak-Mistry-WTW can you provide the terraform you are using? I leveraged below and it is working:

resource "azurerm_resource_group" "resource_group" {
  name     = "rg-test"
  location = "eastus"

}

module "avm-res-managedidentity-userassignedidentity" {
  source  = "Azure/avm-res-managedidentity-userassignedidentity/azurerm"
  name = "uid-test-dev-eus"
  resource_group_name = azurerm_resource_group.resource_group.name
  location = azurerm_resource_group.resource_group.location
  version = "0.3.1"
  # insert the 3 required variables here
}
Dipak-Mistry-WTW commented 2 months ago

@JFolberth My source looks like this for a working one:

source = "git::https://github.com/Azure/terraform-azurerm-avm-res-network-networksecuritygroup.git?ref=v0.2.0"

Most other modules support using this method of referencing a source. I've found the user assigned managed identity and databricks workspace modules don't work in this way.

JFolberth commented 2 months ago

@Dipak-Mistry-WTW

I just did and it works:

module "avm-res-managedidentity-userassignedidentity" {
  source  = "git::https://github.com/Azure/terraform-azurerm-avm-res-managedidentity-userassignedidentity.git?ref=0.3.1"
}
Dipak-Mistry-WTW commented 2 months ago

Yes - That seems to work. The only difference being the "v" in the string. Most other modules use "?ref=v0.2.0" and this one is just missing the v. Maybe add it to the next release for consistency?

JFolberth commented 2 months ago

@Dipak-Mistry-WTW I wanted to follow up as I brought up this concern to the general core team and the feedback was that obtaining the module via the Hashicorp provider is the supported way and there is no direction at this time to enforce the GitHub naming standard of the tag/release.

For what it is worth the official doc show x.x.x as the standard https://azure.github.io/Azure-Verified-Modules/specs/shared/#id-snfr17---category-release---semantic-versioning and https://azure.github.io/Azure-Verified-Modules/contributing/terraform/terraform-contribution-flow/owner-contribution-flow/#7-publish-the-module

If you feel this is something the team should prioritize I'd advise to open up a general issue under https://github.com/Azure/Azure-Verified-Modules/issues

Dipak-Mistry-WTW commented 2 months ago

Thanks I've raised an issue but it's obviously low priority.