Azure / terraform-azurerm-avm-ptn-alz-management

AVM Terraform Pattern Module for ALZ Management.
https://registry.terraform.io/modules/Azure/avm-ptn-alz-management/azurerm/latest
MIT License
4 stars 3 forks source link

TF fails to download module citing uncommitted changes #26

Closed markroloff closed 5 months ago

markroloff commented 5 months ago

Is there an existing issue for this?

Greenfield/Brownfield provisioning

greenfield

Terraform Version

1.3.9

Module Version

0.1.0

AzureRM Provider Version

3.91.0

Affected Resource(s)/Data Source(s)

avm-ptn-alz-management

Terraform Configuration Files

terraform {
  required_version = ">= 1.3.9"

  required_providers {
    alz = {
      source  = "azure/alz"
      version = ">= 0.11.0"
    }
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 3.91.0"
    }
    random = {
      source  = "hashicorp/random"
      version = ">= 3.5.0"
    }
  }
}

provider "alz" {}

provider "azurerm" {
  features {}
}

module "alz-management-resources" {
  source  = "Azure/avm-ptn-alz-management/azurerm"
  version = "0.1.0"

  location                     = "westus"
  log_analytics_workspace_name = "blah-laws"
  resource_group_name          = "blah-rg"
  automation_account_name      = "wontcreate"
  log_analytics_solution_plans = []
  linked_automation_account_creation_enabled = false
}

tfvars variables values

none

Debug Output/Panic Output

│ Error: Failed to download module
│ 
│ Could not download module "alz_management_resources" (main.tf:8) source code from "git::https://github.com/Azure/terraform-azurerm-avm-ptn-alz-management?ref=e003f9eb6b951c7543e0e348da9406c63118ed50": error
│ downloading 'https://github.com/Azure/terraform-azurerm-avm-ptn-alz-management?ref=e003f9eb6b951c7543e0e348da9406c63118ed50': /usr/local/bin/git exited with 1: error: Your local changes to the following files would
│ be overwritten by checkout:
│       .github/PULL_REQUEST_TEMPLATE.md
│ Please commit your changes or stash them before you switch branches.
│ Aborting
│ .
╵

Expected Behaviour

Module downloads successfully and terraform initializes

Actual Behaviour

I have no local repo at this time, so there's no files of my own generating this error. If I download the module directly from the repo here and reference it locally the issue goes away, but it does still complain about overwriting the same file when copying it into a new folder. Which makes no sense because there's nothing there to overwrite.

The module files do appear to make it into the .terraform folder when using the TF registry as a source but terraform init fails to complete due to the provided error.

If I cd down into the module's folder and run git status and git diff, I get the following output:

vscode ➜ .../Management/.terraform/modules/alz_management_resources (main) $ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .github/PULL_REQUEST_TEMPLATE.md

no changes added to commit (use "git add" and/or "git commit -a")
vscode ➜ .../Management/.terraform/modules/alz_management_resources (main) $ git diff
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1346202..09ff08e 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,32 +1,13 @@
-## Description
+## Describe your changes

-<!--
->Thank you for your contribution !
-> Please include a summary of the change and which issue is fixed.
-> Please also include the context.
-> List any dependencies that are required for this change.
+## Issue number

-Fixes #123
-Closes #456
--->
+#000
:...skipping...
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1346202..09ff08e 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,32 +1,13 @@
-## Description
+## Describe your changes

-<!--
->Thank you for your contribution !
-> Please include a summary of the change and which issue is fixed.
-> Please also include the context.
-> List any dependencies that are required for this change.
+## Issue number

-Fixes #123
-Closes #456
--->
+#000

-## Type of Change
+## Checklist before requesting a review
+- [ ] The pr title can be used to describe what this pr did in `CHANGELOG.md` file
+- [ ] I have executed pre-commit on my machine
+- [ ] I have passed pr-check on my machine

-<!-- Use the check-boxes [x] on the options that are relevant. -->
+Thanks for your cooperation!

-- [ ] Non-module change (e.g. CI/CD, documentation, etc.)
-- [ ] Azure Verified Module updates:
-  - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `locals.version.tf.json`:
-    - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
-    - [ ] The bug was found by the module author, and no one has opened an issue to report it yet.
-  - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `locals.version.tf.json`.
-  - [ ] Breaking changes and I have bumped the MAJOR version in `locals.version.tf.json`.
-  - [ ] Update to documentation
:...skipping...
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1346202..09ff08e 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,32 +1,13 @@
-## Description
+## Describe your changes

-<!--
->Thank you for your contribution !
-> Please include a summary of the change and which issue is fixed.
-> Please also include the context.
-> List any dependencies that are required for this change.
+## Issue number

-Fixes #123
-Closes #456
--->
+#000

-## Type of Change
+## Checklist before requesting a review
+- [ ] The pr title can be used to describe what this pr did in `CHANGELOG.md` file
+- [ ] I have executed pre-commit on my machine
+- [ ] I have passed pr-check on my machine

-<!-- Use the check-boxes [x] on the options that are relevant. -->
+Thanks for your cooperation!

-- [ ] Non-module change (e.g. CI/CD, documentation, etc.)
-- [ ] Azure Verified Module updates:
-  - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `locals.version.tf.json`:
-    - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
-    - [ ] The bug was found by the module author, and no one has opened an issue to report it yet.
-  - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `locals.version.tf.json`.
-  - [ ] Breaking changes and I have bumped the MAJOR version in `locals.version.tf.json`.
-  - [ ] Update to documentation
-
-# Checklist
-
-- [ ] I'm sure there are no other open Pull Requests for the same update/change
-- [ ] My corresponding pipelines / checks run clean and green without any errors or warnings
-- [ ] I did run all  [pre-commit](https://azure.github.io/Azure-Verified-Modules/contributing/terraform/terraform-contribution-flow/#5-run-pre-commit-checks) checks
-
-<!--  Please keep up to date with the contribution guide at https://aka.ms/avm/contribute/terraform -->
~

Steps to Reproduce

terraform init

Important Factoids

No response

References

No response

luke-taylor commented 5 months ago

Hey @markroloff I think the recent AVM alignment PR has put two files with the same name in the repo, namely, PULL_REQUEST_TEMPLATE.md and pull_request_template.md I'll put a PR in to remove the old one.