Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
## Describe your changes

We have a new alternative virtual machine module, this pull request added an introduction of this new module in the readme file.

## Issue number

#000

## 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

Thanks for your cooperation!

---

Choice A:
README.md
@@ -1,5 +1,9 @@
 # terraform-azurerm-compute

+## Notice on new alternative virtual machine module
+
+This module was designed and implemented for AzureRM Provider v2.x, It's impossible to refactor this module from `azurerm_virtual_machine` to the modern version `azurerm_linux_virtual_machine` and `azurerm_windows_virtual_machine`. For those who're maintaining infrastructure on brownfield, our welcome to continue using this module; for those who're about to provision new infrastructure on greenfield, you're welcome to try our new alternative: [terraform-azurerm-virtual-machine](https://registry.terraform.io/modules/Azure/virtual-machine/azurerm/latest).
+
 ## Notice on Upgrade to v5.x

 As [#218](https://github.com/Azure/terraform-azurerm-compute/pull/218) described, the `plan` block introduced by [#209](https://github.com/Azure/terraform-azurerm-compute/pull/209) was incorrect so we must adjust the assignments' order, which is a breaking change. The change we've made to vm's `plan` block is:
---

---

Choice B:
README.md
@@ -1,5 +1,9 @@
 # terraform-azurerm-compute

+## Notice on new alternative virtual machine module
+
+This module was designed and implemented for AzureRM Provider v2.x, It's impossible to refactor this module from `azurerm_virtual_machine` to the modern version `azurerm_linux_virtual_machine` and `azurerm_windows_virtual_machine`. For those who're maintaining infrastructure on brownfield, you're welcome to continue using this module; for those who're about to provision new infrastructure on greenfield, you're welcome to try our new alternative: [terraform-azurerm-virtual-machine](https://registry.terraform.io/modules/Azure/virtual-machine/azurerm/latest).
+
 ## Notice on Upgrade to v5.x

 As [#218](https://github.com/Azure/terraform-azurerm-compute/pull/218) v5.x
 the `plan` block introduced by [#209](https://github.com/Azure/terraform-azurerm-compute/pull/209) was incorrect so we must adjust the assignments' order, which is a breaking change. The change we've made to vm's `plan` block is:
---

---

Choice C:
README.md
@@ -1,5 +1,9 @@
 # terraform-azurerm-compute

+## Notice on new alternative virtual machine module
+
+This module was designed and implemented for AzureRM Provider v2.x, It's impossible to refactor this module from `azurerm_virtual_machine` to the modern version `azurerm_linux_virtual_machine` and `azurerm_windows_virtual_machine`. For those who're maintaining infrastructure on brownfield, you're welcome to continue using this module; for those who're about to provision new infrastructure on greenfield, you're welcome to try our new alternative: [terraform-azurerm-virtual-machine](https://registry.terraform.io/modules/Azure/virtual-machine/azurerm/latest).
+
 ## Notice on Upgrade to v5.x

 As [#218](https://github.com/Azure/terraform-azurerm-compute/pull/218) described, the `plan` block introduced by [#209](https://github.com/Azure/terraform-azurerm-compute/pull/209) was incorrect so we must adjust the assignments' order, which is a breaking change. The change we've made to vm's `plan` block module
+
+This

---

Choice D:
README.md
@@ -1,5 +1,9 @@
 # terraform-azurerm-compute

+## Notice on new alternative virtual machine module
+
+This module was designed and implemented for AzureRM Provider v2.x, It's impossible to refactor this module from `azurerm_virtual_machine` to the modern version `azurerm_linux_virtual_machine` and `azurerm_windows_virtual_machine`. For those who're maintaining infrastructure on brownfield, you're welcome to continue using this module; for those who're about to provision new infrastructure on greenfield, you're welcome to try our new alternative: [terraform-azurerm-virtual-machine](https://registry.terraform.io/modules/Azure/virtual-machine/azurerm/latest).
+
 ## Notice on Upgrade to v5.x

 As [#218](https://github.com/Azure/terraform-azurerm-compute/pull/218) described, the `plan` block introduced by [#209](https://github.com/Azure/terraform-azurerm-compute/pull/209) was incorrect so we must adjust the assignments' order, which is a breaking change. The change we've made to vm's `plan` block is:
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
## Changed the Terraform Version Constraint on `versions.tf` to `~> 1.3`.

## Issue Number

#222

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

Thanks for your cooperation!

---

Choice A:
README.md
@@ -408,7 +408,7 @@ Originally created by [David Tesar](http://github.com/dtzar)

 | Name                                                                      | Version        |
 |---------------------------------------------------------------------------|----------------|
-|  [terraform](#requirement\_terraform) | >= 1.2         |
+|  [terraform](#requirement\_terraform) | >= 1.3         |
 |  [azurerm](#requirement\_azurerm)       | >= 3.11, < 4.0 |
 |  [random](#requirement\_random)          | >=3.0.0        |

---
unit-fixture/locals.tf
@@ -1 +1 @@
-../locals.tf
\ No newline at end of file
+../locals.tf
---
unit-fixture/variables.tf
@@ -1 +1 @@
-../variables.tf
\ No newline at end of file
+../variables.tf
---
versions.tf
@@ -1,5 +1,5 @@
 terraform {
-  required_version = ">= 1.2"
+  required_version = ">= 1.3"

   required_providers {
     azurerm = {
@@ -11,4 +11,4 @@ terraform {
       version = ">=3.0.0"
     }
   }
-}
\ No newline at end of file
+}
---

---

Choice B:
README.md
@@ -408,7 +408,7 @@ Originally created by [David Tesar](http://github.com/dtzar)

 | Name                                                                      | Version        |
 |---------------------------------------------------------------------------|----------------|
-|  [terraform](#requirement\_terraform) | >= 1.2         |
+|  [terraform](#requirement\_terraform) | >= 1.3         |
 |  [azurerm](#requirement\_azurerm)       | >= 3.11, < 4.0 |
 |  [random](#requirement\_random)          | >=3.0.0        |

---
unit-fixture/locals.tf
@@ -1 +1 @@
-../locals.tf
\ No newline at end of file
+../locals.tf
---
unit-fixture/variables.tf
@@ -1 +1 @@
-../variables.tf
\ No newline at end of file
+../variables.tf
---
versions.tf
@@ -1,5 +1,5 @@
 terraform {
-  required_version = ">= 1.2"
+  required_version = ">= 1.3"

   required_providers {
     azurerm = {
@@ -11,4 +11,4 @@ terraform {
       version = ">=3.0.0"
     }
   }
-}
\ No newline at end of file
+}
---

---

Choice C:
README.md
@@ -408,7 +408,7 @@ Originally created by [David Tesar](http://github.com/dtzar)

 | Name               newline                                                       | Version        |
 |---------------------------------------------------------------------------|----------------|
-|  [terraform](#requirement\_terraform) | >= 1.2         |
+|  [terraform](#requirement\_terraform) | >= 1.3         |
 |  [azurerm](#requirement\_azurerm)       | >= 3.11, < 4.0 |
 |  [random](#requirement\_random)          | >=3.0.0        |

---
unit-fixture/locals.tf
@@ -1 +1 @@
-../locals.tf
\ No newline at end of file
+../locals.tf
---
unit-fixture/variables.tf
@@ -1 +1 @@
-../variables.tf
\ No newline at end of file
+../variables.tf
---
versions.tf
@@ -1,5 +1,5 @@
 terraform {
-  required_version = ">= 1.2"
+  required_version = ">= 1.3"

   required_providers {
     azurerm = {
@@ -11,4 +11,4 @@ terraform {
       version = ">=3.0.0"
     }
   }
-}
\ No newline at end of file
+}
---

---

Choice D:
README.md
@@ -408,7 +408,7 @@ Originally created by [David Tesar](http://github.com/dtzar)

 | Name                                                                      | Version        |
 |---------------------------------------------------------------------------|----------------|
-|  [terraform](#requirement\_terraform) | >= 1.2         |
+|  [terraform](#requirement\_terraform) | >= 1.3         |
 |  [azurerm](#requirement\_azurerm)       | >= 3.11, < 4.0 |
 |  [random](#requirement\_random)          | >=3.0.0        |

---
unit-fixture/locals.tf
@@ -1 +1 @@
-../locals.tf
\ No newline at end of file
+../locals.tf
---
unit-fixture/variables.tf
@@ -1 +1 @@
-../variables.tf
\ No newline at end of file
+../variables.tf
---
versions.tf
@@ -1,5 +1,5 @@
 terraform {
-  required_version = ">= 1.2"
+  required_version = ">= 1.3"

   required_providers {
     azurerm = {
@@ -11,4 +11,4 @@ terraform {
       version = ">=3.0.0"
     }
   }
-}
\ No newline at end of file
+}
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Bumps [github.com/Azure/terraform-module-test-helper](https://github.com/Azure/terraform-module-test-helper) from 0.6.0 to 0.7.1.

Commits

81e253e skip version upgrade test on v0.x.x, there might be no tag on github repo

8c88c23 Bump github.com/gruntwork-io/terratest from 0.41.7 to 0.41.9 (#7)

6d506d8 skip destroy if there is no tfstate file

20e82e2 try destroy without refresh first to avoid invalid tf code blocking destroy

904a2b9 do not retry on apply

2db9ef1 try to avoid unnecessary retry

1d2f138 adjust test version snapshot tostring format

85fb2fe when execute destroy, try 5 times destroy with refresh, then 5 times without ...

98552d8 fix lint issue

6c23db2 discard get version's stdout, do not use json

Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/Azure/terraform-module-test-helper&package-manager=go_modules&previous-version=0.6.0&new-version=0.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---

Choice A:
test/go.mod
@@ -3,7 +3,7 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.6.0
+	github.com/Azure/terraform-module-test-helper v0.7.1
 	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify github.com/Azure/terraform-azurerm-compute
 )
---

---

Choice B:
test/go.mod
@@ -3,7 +3,7 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.6.0
+	github.com/Azure/terraform-module-test-helper v0.7.1
 	github.com/gruntwork-io/terratest v0.41.9
 v1.8.1
 v1.8.1
 )
---

---

Choice C:
test/go.mod
@@ -3,7 +3,7 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.6.0
+	github.com/Azure/terraform-module-test-helper v0.7.1
 	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify v1.8.1
 )
---

---

Choice D:
test/go.mod
@@ -3,7 +3,7 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.6.0
+	github.com/Azure/terraform-module-test-helper v0.7.1
 	github.com/gruntwork-io/terratest v0.41.9
 1.19
 v1.8.1
 )
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.7 to 0.41.9.

Release notes

Sourced from github.com/gruntwork-io/terratest's releases.

v0.41.9

Modules affected

docker

Description

Added a new attribute to docker-compose options named ProjectName which allows customizing the project name when docker-compose is executed.

Special thanks

Special thanks to the following users for their contribution!

@apenella

Related links

gruntwork-io/terratest#1187

... (truncated)

Commits

6264798 Merge pull request #1187 from apenella/docker-compose-projectname

599561b Merge pull request #1223 from lahabana/addPodStatus

a735c77 add pod.Status.{Reason,Message} to PodNotAvailable error

a17372c cleanup fixtures

c316a70 testing docker compose project name

6f719b0 testing docker compose project name

8fcd2aa pre-commit migrate-config

29d7d80 fix conflicts from 0.41.6

See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/gruntwork-io/terratest&package-manager=go_modules&previous-version=0.41.7&new-version=0.41.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---

Choice A:
1.19
 -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.6.0
-	github.com/gruntwork-io/terratest v0.41.7
+	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify v1.8.1
 )

---

---

Choice B:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.6.0
-	github.com/gruntwork-io/terratest v0.41.7
+	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify v1.8.1
 )
 test/go.mod
@@

---

Choice C:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 go (
 	github.com/Azure/terraform-module-test-helper v0.6.0
-	github.com/gruntwork-io/terratest v0.41.7
+	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify v1.8.1
 )

---

---

Choice D:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.6.0
-	github.com/gruntwork-io/terratest v0.41.7
+	github.com/gruntwork-io/terratest v0.41.9
 	github.com/stretchr/testify v1.8.1
 )

---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
## Describe your changes
When attempting to use a marketplace image, the terraform apply will currently fail with:

> │ Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourcePurchaseValidationFailed" Message="User failed validation to purchase resources. Error message: 'The offer with Offer ID '8-gen1' was not
> found. Try one of these: 1- Make sure the offer name is written correctly. 2- If this offer was recently created, allow up to 30 minutes for it to be available for purchase. 3- The offer may have been removed from the marketplace. Look for similar offers from this p
> ublisher here: 'https://azuremarketplace.microsoft.com/en-us/marketplace/apps?page=1%26search=almalinux%208-gen1'. Publisher ID: 'almalinux', Offer ID: '8-gen1', Correlation ID 'XXX'.'"

Currently the "plan" input is constructed as:

```
  dynamic "plan" {
    for_each = var.is_marketplace_image ? ["plan"] : []

    content {
      name      = var.vm_os_offer
      product   = var.vm_os_sku
      publisher = var.vm_os_publisher
    }
  }
```

However, the name and product are being used incorrectly here. For example, consider image with URN **almalinux:almalinux:8-gen1:8.7.2022122801**. The 'az vm image list' and 'az vm image show' output for this image is (with some redactions):

```
[user@server]$ az vm image list --location eastus --publisher almalinux --offer almalinux --all
  {
    "offer": "almalinux",
    "publisher": "almalinux",
    "sku": "8-gen1",
    "urn": "almalinux:almalinux:8-gen1:8.7.2022122801",
    "version": "8.7.2022122801"
  },
```

```
[user@server]$ az vm image show -l eastus --urn almalinux:almalinux:8-gen1:8.7.2022122801
{
  "id": "/Subscriptions/f60cdb4a-1023-47c6-a3ff-6a3ef043f74d/Providers/Microsoft.Compute/Locations/eastus/Publishers/almalinux/ArtifactTypes/VMImage/Offers/almalinux/Skus/8-gen1/Versions/8.7.2022122801",
  "location": "eastus",
  "name": "8.7.2022122801",
  "plan": {
    "name": "8-gen1",
    "product": "almalinux",
    "publisher": "almalinux"
  },
}
```

So if I wish to schedule this image, the **correct** "plan" values are:

- Publisher: almalinux
- Product: almalinux
- Name: 8-gen1

However, the **incorrect** "plan" input currently being constructed by this module instead is:

- Publisher: almalinux
- Product: 8-gen1
- Name: almalinux

In short, the **product** and **name** are swapped. This PR is to correct this behavior.

## Issue number
No issue

## Checklist before requesting a review
- [X] 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

Thanks for your cooperation!

---

Choice A:
main.tf
@@ -131,8 +131,8 @@ resource "azurerm_virtual_machine" "vm_linux" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
@@ -245,8 +245,8 @@ resource "azurerm_virtual_machine" "vm_windows" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   }
---
 var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
---

---

Choice B:
main.tf
@@ -131,8 +131,8 @@ resource "azurerm_virtual_machine" "vm_linux" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
@@ -245,8 +245,8 @@ resource "azurerm_virtual_machine" "vm_windows" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
---

---

Choice C:
main.tf
@@ -131,8 +131,8 @@ resource "azurerm_virtual_machine" "vm_linux" {
     []
 = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
@@ -245,8 +245,8 @@ resource "azurerm_virtual_machine" "vm_windows" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
---

---

Choice D:
main.tf
@@ -131,8 +131,8 @@ resource "azurerm_virtual_machine" "vm_linux" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
@@ -245,8 +245,8 @@ resource "azurerm_virtual_machine" "vm_windows" {
     for_each = var.is_marketplace_image ? ["plan"] : []

     content {
-      name      = var.vm_os_offer
-      product   = var.vm_os_sku
+      name      = var.vm_os_sku
+      product   = var.vm_os_offer
       publisher = var.vm_os_publisher
     }
   }
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Bumps [github.com/Azure/terraform-module-test-helper](https://github.com/Azure/terraform-module-test-helper) from 0.4.0 to 0.6.0.

Commits

95c1e9f add error check for destroy

e9562dd update badge url

bb388e1 update badge url

100c98b disable refresh when execute destroy so config validation error won't block d...

3ed5b08 Bump github.com/hashicorp/hcl/v2 from 2.12.0 to 2.15.0 (#6)

0a5e8ac add devcontainer config

a91ce95 Bump github.com/hashicorp/terraform-json from 0.13.0 to 0.14.0 (#5)

97f504c Bump github.com/hashicorp/go-getter/v2 from 2.1.0 to 2.1.1 (#4)

4d6d043 Bump github.com/gruntwork-io/terratest from 0.41.6 to 0.41.7 (#3)

24e73fb Bump github.com/spf13/afero from 1.2.2 to 1.9.3 (#2)

Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/Azure/terraform-module-test-helper&package-manager=go_modules&previous-version=0.4.0&new-version=0.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---

Choice A:
test/go.mod
@@ -3,14 +3,14 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.4.0
+	github.com/Azure/terraform-module-test-helper v0.6.0
 	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

 require (
 	cloud.google.com/go v0.83.0 // indirect
-	cloud.google.com/go/storage v1.10.0 // indirect
+	cloud.google.com/go/storage v1.14.0 // indirect
 	github.com/agext/levenshtein v1.2.3 // indirect
 	github.com/ahmetb/go-linq/v3 v3.2.0 // indirect
 	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -38,14 +38,14 @@ require (
 	github.com/hashicorp/errwrap v1.0.0 // indirect
 	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 	github.com/hashicorp/go-getter v1.6.1 // indirect
-	github.com/hashicorp/go-getter/v2 v2.1.0 // indirect
+	github.com/hashicorp/go-getter/v2 v2.1.1 // indirect
 	github.com/hashicorp/go-multierror v1.1.0 // indirect
 	github.com/hashicorp/go-safetemp v1.0.0 // indirect
-	github.com/hashicorp/go-version v1.3.0 // indirect
+	github.com/hashicorp/go-version v1.5.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/hashicorp/hcl/v2 v2.12.0 // indirect
+	github.com/hashicorp/hcl/v2 v2.15.0 // indirect
 	github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f // indirect
-	github.com/hashicorp/terraform-json v0.13.0 // indirect
+	github.com/hashicorp/terraform-json v0.14.0 // indirect
 	github.com/imdario/mergo v0.3.11 // indirect
 	github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
 	github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -65,18 +65,18 @@ require (
 	github.com/pquerna/otp v1.2.0 // indirect
 	github.com/r3labs/diff/v3 v3.0.0 // indirect
 	github.com/russross/blackfriday/v2 v2.1.0 // indirect
-	github.com/spf13/afero v1.2.2 // indirect
+	github.com/spf13/afero v1.9.3 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/tmccombs/hcl2json v0.3.3 // indirect
 	github.com/ulikunitz/xz v0.5.8 // indirect
 	github.com/urfave/cli v1.22.2 // indirect
 	github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
-	github.com/zclconf/go-cty v1.9.1 // indirect
+	github.com/zclconf/go-cty v1.12.1 // indirect
 	go.opencensus.io v0.23.0 // indirect
-	golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
+	golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
 	golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
 	golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
-	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f v1.2.2 indirect
+	golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
 	golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
 	golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
 	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
---

---

Choice B:
test/go.mod
@@ -3,14 +3,14 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.4.0
+	github.com/Azure/terraform-module-test-helper v0.6.0
 	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

 require indirect
+	github.com/hashicorp/go-getter/v2 	cloud.google.com/go v0.83.0 // indirect
-	cloud.google.com/go/storage v1.10.0 // indirect
+	cloud.google.com/go/storage v1.14.0 // indirect
 	github.com/agext/levenshtein v1.2.3 // indirect
 	github.com/ahmetb/go-linq/v3 v3.2.0 // indirect
 	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -38,14 +38,14 @@ require (
 	github.com/hashicorp/errwrap v1.0.0 // indirect
 	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 	github.com/hashicorp/go-getter v1.6.1 // indirect
-	github.com/hashicorp/go-getter/v2 v2.1.0 // indirect
+	github.com/hashicorp/go-getter/v2 v2.1.1 // indirect
 	github.com/hashicorp/go-multierror v1.1.0 // indirect
 	github.com/hashicorp/go-safetemp v1.0.0 // indirect
-	github.com/hashicorp/go-version v1.3.0 // indirect
+	github.com/hashicorp/go-version v1.5.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/hashicorp/hcl/v2 v2.12.0 // indirect
+	github.com/hashicorp/hcl/v2 v2.15.0 // indirect
 	github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f // indirect
-	github.com/hashicorp/terraform-json v0.13.0 // indirect
+	github.com/hashicorp/terraform-json v0.14.0 // indirect
 	github.com/imdario/mergo v0.3.11 // indirect
 	github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
 	github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -65,18 +65,18 @@ require (
 	github.com/pquerna/otp v1.2.0 // indirect
 	github.com/r3labs/diff/v3 v3.0.0 // indirect
 	github.com/russross/blackfriday/v2 v2.1.0 // indirect
-	github.com/spf13/afero v1.2.2 // indirect
+	github.com/spf13/afero v1.9.3 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/tmccombs/hcl2json v0.3.3 // indirect
 	github.com/ulikunitz/xz v0.5.8 // indirect
 	github.com/urfave/cli v1.22.2 // indirect
 	github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
-	github.com/zclconf/go-cty v1.9.1 // indirect
+	github.com/zclconf/go-cty v1.12.1 // indirect
 	go.opencensus.io v0.23.0 // indirect
-	golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
+	golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
 	golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
 	golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
-	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
+	golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
 	golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
 	golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
 	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
---

---

Choice C:
test/go.mod
@@ -3,14 +3,14 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.4.0
+	github.com/Azure/terraform-module-test-helper v0.6.0
 	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

 require (
 	cloud.google.com/go v0.83.0 // indirect
-	cloud.google.com/go/storage v1.10.0 // indirect
+	cloud.google.com/go/storage v1.14.0 // indirect
 	github.com/agext/levenshtein v1.2.3 // indirect
 	github.com/ahmetb/go-linq/v3 v3.2.0 // indirect
 	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -38,14 +38,14 @@ require (
 	github.com/hashicorp/errwrap v1.0.0 // indirect
 	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 	github.com/hashicorp/go-getter v1.6.1 // indirect
-	github.com/hashicorp/go-getter/v2 v2.1.0 // indirect
+	github.com/hashicorp/go-getter/v2 v2.1.1 // indirect
 	github.com/hashicorp/go-multierror v1.1.0 // indirect
 	github.com/hashicorp/go-safetemp v1.0.0 // indirect
-	github.com/hashicorp/go-version v1.3.0 // indirect
+	github.com/hashicorp/go-version v1.5.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/hashicorp/hcl/v2 v2.12.0 // indirect
+	github.com/hashicorp/hcl/v2 v2.15.0 // indirect
 	github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f // indirect
-	github.com/hashicorp/terraform-json v0.13.0 // indirect
+	github.com/hashicorp/terraform-json v0.14.0 // indirect
 	github.com/imdario/mergo v0.3.11 // indirect
 	github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
 	github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -65,18 +65,18 @@ require (
 	github.com/pquerna/otp v1.2.0 // indirect
 	github.com/r3labs/diff/v3 v3.0.0 // indirect
 	github.com/russross/blackfriday/v2 v2.1.0 // indirect
-	github.com/spf13/afero v1.2.2 // indirect
+	github.com/spf13/afero v1.9.3 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/tmccombs/hcl2json v0.3.3 // indirect
 	github.com/ulikunitz/xz v0.5.8 // indirect
 	github.com/urfave/cli v1.22.2 // indirect
 	github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
-	github.com/zclconf/go-cty v1.9.1 // indirect
+	github.com/zclconf/go-cty v1.12.1 // indirect
 	go.opencensus.io v0.23.0 // indirect
-	golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
+	golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
 	golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
 	golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
-	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
+	golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
 	golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
 	golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
 	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
---

---

Choice D:
test/go.mod
@@ -3,14 +3,14 @@ module github.com/Azure/terraform-azurerm-compute
 go 1.19

 require (
-	github.com/Azure/terraform-module-test-helper v0.4.0
+	github.com/Azure/terraform-module-test-helper v0.6.0
 	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

 require (
 	cloud.google.com/go v0.83.0 // indirect
-	cloud.google.com/go/storage v1.10.0 // indirect
+	cloud.google.com/go/storage v1.14.0 // indirect
 	github.com/agext/levenshtein v1.2.3 // indirect
 	github.com/ahmetb/go-linq/v3 v3.2.0 // indirect
 	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -38,14 +38,14 @@ require (
 	github.com/hashicorp/errwrap v1.0.0 // indirect
 	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 	github.com/hashicorp/go-getter v1.6.1 // indirect
-	github.com/hashicorp/go-getter/v2 v2.1.0 // indirect
+	github.com/hashicorp/go-getter/v2 v2.1.1 // indirect
 	github.com/hashicorp/go-multierror v1.1.0 // indirect
 	github.com/hashicorp/go-safetemp v1.0.0 // indirect
-	github.com/hashicorp/go-version v1.3.0 // indirect
+	github.com/hashicorp/go-version v1.5.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/hashicorp/hcl/v2 v2.12.0 // indirect
+	github.com/hashicorp/hcl/v2 v2.15.0 // indirect
 	github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f // indirect
-	github.com/hashicorp/terraform-json v0.13.0 // indirect
+	github.com/hashicorp/terraform-json v0.14.0 // indirect
 	github.com/imdario/mergo v0.3.11 // indirect
 	github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
 	github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -65,18 +65,18 @@ require (
 	github.com/pquerna/otp v1.2.0 // indirect
 	github.com/r3labs/diff/v3 v3.0.0 // indirect
 	github.com/russross/blackfriday/v2 v2.1.0 // indirect
-	github.com/spf13/afero v1.2.2 // indirect
+	github.com/spf13/afero v1.9.3 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/tmccombs/hcl2json v0.3.3 // indirect
 	github.com/ulikunitz/xz v0.5.8 // indirect
 	github.com/urfave/cli v1.22.2 // indirect
 	github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
-	github.com/zclconf/go-cty v1.9.1 // indirect
+	github.com/zclconf/go-cty v1.12.1 // indirect
 	go.opencensus.io v0.23.0 // indirect
-	golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
+	golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect
 	golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
 	golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
-	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
+	golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
 	golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
 	golang.org/x/sys // // indirect
 	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.41.6 to 0.41.7.

Release notes

Sourced from github.com/gruntwork-io/terratest's releases.

v0.41.7

Modules affected

terraform

Description

Added to terraform options parameter SetVarsAfterVarFiles which allows reordering var and var-file flags

Special thanks

Special thanks to the following users for their contribution!

@chilledornaments

Related links

gruntwork-io/terratest#1217

... (truncated)

Commits

e63181e Merge pull request #1217 from chilledornaments/master

cee5e91 refactor test logic to compare index

7da6e5e utilize checkResultWithRetry func for tests

c308bf7 fix test expectations, add test case

cdc0dc4 rename field

56a2e8d uncomment test

5d0e65f add logic for setting var options after var-file

See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/gruntwork-io/terratest&package-manager=go_modules&previous-version=0.41.6&new-version=0.41.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---

Choice A:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.4.0
-	github.com/gruntwork-io/terratest v0.41.6
+	github.com/gruntwork-io/terratest v0.41.7
 require v1.8.1
 )

---

---

Choice B:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.4.0
-	github.com/gruntwork-io/terratest v0.41.6
+	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify
 )

---

---

Choice C:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
 	github.com/Azure/terraform-module-test-helper v0.4.0
-	github.com/gruntwork-io/terratest v0.41.6
+	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

---

---

Choice D:
test/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require v0.4.0
-	github.com/gruntwork-io/terratest 	github.com/Azure/terraform-module-test-helper v0.4.0
-	github.com/gruntwork-io/terratest v0.41.6
+	github.com/gruntwork-io/terratest v0.41.7
 	github.com/stretchr/testify v1.8.1
 )

---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Solve #107 by adding `create_before_destroy = true` to defer public ip's deletion.

Issue #107's root cause is Terraform will try to execute deletion before update, once we tried to delete the public ip, it is still attached on the network interface.

Declare this `create_before_destroy` will defer this public ip resource's deletion after creation and update so we can fix the issue.

## Describe your changes

## Issue number

#107

## 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

Thanks for your cooperation!

---

Choice A:
main.tf
@@ -49,7 +49,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]),  && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -162,7 +164,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -275,6 +279,13 @@ resource "azurerm_public_ip" "vm" {
   sku                 = var.public_ip_sku
   tags                = var.tags
   zones               = var.zone == null ? null : [var.zone]
+
+  # To solve issue [#107](https://github.com/Azure/terraform-azurerm-compute/issues/107) we add such block to make `azurerm_network_interface.vm`'s update happen first.
+  # Issue #107's root cause is Terraform will try to execute deletion before update, once we tried to delete the public ip, it is still attached on the network interface.
+  # Declare this `create_before_destroy` will defer this public ip resource's deletion after creation and update so we can fix the issue.
+  lifecycle {
+    create_before_destroy = true
+  }
 }

 # Dynamic public ip address will be got after it's assigned to a vm
@@ -323,8 +334,10 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
-    subnet_id                     = var.vnet_subnet_id
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
+      ""
+    ])), count.index) : ""
+    subnet_id = var.vnet_subnet_id
   }
 }

---

---

Choice B:
main.tf
@@ -49,7 +49,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -162,7 +164,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -275,6 +279,13 @@ resource "azurerm_public_ip" "vm" {
   sku                 = var.public_ip_sku
   tags                = var.tags
   zones               = var.zone == null ? null : [var.zone]
+
+  # To solve issue [#107](https://github.com/Azure/terraform-azurerm-compute/issues/107) we add such block to make `azurerm_network_interface.vm`'s update happen first.
+  # Issue #107's root cause is Terraform will try to execute deletion before update, once we tried to delete the public ip, it is still attached on the network interface.
+  # Declare this `create_before_destroy` will defer this public ip resource's deletion after creation and update so we can fix the issue.
+  lifecycle {
+    create_before_destroy = true
+  }
 }

 # Dynamic public ip address will be got after it's assigned to a vm
@@ -323,8 +334,10 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
-    subnet_id                     = var.vnet_subnet_id
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
+      ""
+    ])), count.index) : ""
+    subnet_id = var.vnet_subnet_id
   }
 }

---

---

Choice C:
main.tf
@@ -49,7 +49,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -162,7 +164,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -275,6 +279,13 @@ resource "azurerm_public_ip" "vm" {
   sku                 = var.public_ip_sku
   tags                = var.tags
   zones               = var.zone == null ? null : [var.zone]
+
+  # To solve issue [#107](https://github.com/Azure/terraform-azurerm-compute/issues/107) we add such block to make `azurerm_network_interface.vm`'s update happen first.
+  # Issue #107's root cause is Terraform will try to execute deletion before update, once we tried to delete the public ip, it is still attached on the network interface.
+  # Declare this `create_before_destroy` will defer this public ip resource's deletion after creation and update so we can fix the issue.
+  lifecycle {
+    create_before_destroy = true
+  }
 }

 # Dynamic public ip address will be got after it's assigned to a vm
@@ -323,8 +334,10 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
-    subnet_id                     = var.vnet_subnet_id
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
+      ""
+    ])), count.index) : ""
+    subnet_id = var.vnet_subnet_id
   }
 }

---

---

Choice D:
main.tf
@@ -49,7 +49,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -162,7 +164,9 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([
+    var.vm_os_simple, var.vm_os_offer
+  ]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -275,6 +279,13 @@ resource "azurerm_public_ip" "vm" {
   sku                 = var.public_ip_sku
   tags                = var.tags
   zones               = var.zone == null ? null : [var.zone]
+
+  # To solve issue [#107](https://github.com/Azure/terraform-azurerm-compute/issues/107) we add such block to make `azurerm_network_interface.vm`'s update happen first.
+  # Issue #107's root cause is Terraform will try to execute deletion before update, once we tried to delete the public ip, it is still attached on the network interface.
+  # Declare this `create_before_destroy` will defer this public ip resource's deletion after creation and update so we can fix the issue.
+  lifecycle {
+    create_before_destroy = true
+  }
 }

 # Dynamic public ip address will be got after it's assigned to a vm
@@ -323,8 +334,10 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
-    subnet_id                     = var.vnet_subnet_id
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
+      ""
+    ])), count.index) : ""
+    subnet_id = var.vnet_subnet_id
   }
 }

---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
## Describe your changes

This pull request output vm names so we can composite this module with other modules.

## Issue number

#146 #145

## 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

Thanks for your cooperation!

---

Choice A:
README.md
@@ -466,5 +466,6 @@ Originally created by [David Tesar](http://github.com/dtzar)
 |  [public\_ip\_id](#output\_public\_ip\_id)                                                   | id of the public ip address provisoned.                                                                                |
 |  [vm\_identity](#output\_vm\_identity)                                                        | map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.                               |
 |  [vm\_ids](#output\_vm\_ids)                                                                       | Virtual machine ids created.                                                                                |
+|  [vm\_names](#output\_vm\_names)                                                                 | Virtual machine names created.                                                                                |
 |  [vm\_zones](#output\_vm\_zones)                                                                 | map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in. |

---
examples/complete/outputs.tf
@@ -2,6 +2,10 @@ output "debian2_availability_set_id" {
   value = module.debianservers2.availability_set_id
 }

+output "debian2_vm_names" {
+  value = module.debianservers2.vm_names
+}
+
 output "debian_availability_set_id" {
   value = module.debianservers.availability_set_id
 }
@@ -10,6 +14,10 @@ output "debian_ip_address" {
   value = module.debianservers.public_ip_address
 }

+output "debian_vm_names" {
+  value = module.debianservers.vm_names
+}
+
 output "debian_vm_public_name" {
   value = module.debianservers.public_ip_dns_name
 }
@@ -44,6 +52,10 @@ output "ubuntu_ip_address" {
   value = module.ubuntuservers.public_ip_address
 }

+output "ubuntu_vm_names" {
+  value = module.ubuntuservers.vm_names
+}
+
 output "ubuntu_vm_public_name" {
   value = module.ubuntuservers.public_ip_dns_name
 }
@@ -92,6 +104,10 @@ output "windows_vm_admin_password" {
   value     = local.admin_password
 }

+output "windows_vm_names" {
+  value = module.windowsservers.vm_names
+}
+
 output "windows_vm_public_name" {
   value = module.windowsservers.public_ip_dns_name
-}
+}
\ No newline at end of file
---
outputs.tf
@@ -48,6 +48,14 @@ output "vm_ids" {
   value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

+output "vm_names" {
+  description = "Virtual machine names created."
+  value = {
+    linux   = azurerm_virtual_machine.vm_linux[*].name
+    windows = azurerm_virtual_machine.vm_windows[*].name
+  }
+}
+
 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
   value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
---

---

Choice B:
README.md
@@ -466,5 +466,6 @@ Originally created by [David Tesar](http://github.com/dtzar)
 |  [public\_ip\_id](#output\_public\_ip\_id)                                                   | id of the public ip address provisoned.                                                                                |
 |  [vm\_identity](#output\_vm\_identity)                                                        | map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.                               |
 |  [vm\_ids](#output\_vm\_ids)                                                                       | Virtual machine ids created.                                                                                |
+|  [vm\_names](#output\_vm\_names)                                                                 | Virtual machine names created.                                                                                |
 |  [vm\_zones](#output\_vm\_zones)                                                                 | map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in. |

---
examples/complete/outputs.tf
@@ -2,6 +2,10 @@ output "debian2_availability_set_id" {
   value = module.debianservers2.availability_set_id
 }

+output "debian2_vm_names" {
+  value = module.debianservers2.vm_names
+}
+
 output "debian_availability_set_id" {
   value = module.debianservers.availability_set_id
 }
@@ -10,6 +14,10 @@ output "debian_ip_address" {
   value = module.debianservers.public_ip_address
 }

+output "debian_vm_names" {
+  value = module.debianservers.vm_names
+}
+
 output "debian_vm_public_name" {
   value = module.debianservers.public_ip_dns_name
 }
@@ -44,6 +52,10 @@ output "ubuntu_ip_address" {
   value = module.ubuntuservers.public_ip_address
 }

+output "ubuntu_vm_names" {
+  value = module.ubuntuservers.vm_names
+}
+
 output "ubuntu_vm_public_name" {
   value = module.ubuntuservers.public_ip_dns_name
 }
@@ -92,6 +104,10 @@ output "windows_vm_admin_password" {
   value     = local.admin_password
 }

+output "windows_vm_names" {
+  value = module.windowsservers.vm_names
+}
+
 output "windows_vm_public_name" {
   value = module.windowsservers.public_ip_dns_name
-}
+}
\ No newline at end of file
---
outputs.tf
@@ -48,6 +48,14 @@ output "vm_ids" {
   value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

+output "vm_names" {
+  description = "Virtual machine names created."
+  value = {
+    linux   = azurerm_virtual_machine.vm_linux[*].name
+    windows = azurerm_virtual_machine.vm_windows[*].name
+  }
+}
+
 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
   value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
---

---

Choice C:
README.md
@@ -466,5 +466,6 @@ Originally created by [David Tesar](http://github.com/dtzar)
 |  [public\_ip\_id](#output\_public\_ip\_id)                                                   | id of the public ip address provisoned.                                                                                |
 |  [vm\_identity](#output\_vm\_identity)                                                        | map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.                               |
 |  [vm\_ids](#output\_vm\_ids)                                                                       | Virtual machine ids created.                                                                                |
+|  [vm\_names](#output\_vm\_names)                                                                 | Virtual machine names created.                                                                                |
 |  [vm\_zones](#output\_vm\_zones)                                                                 | map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in. |

---
examples/complete/outputs.tf
@@ -2,6 +2,10 @@ output "debian2_availability_set_id" {
   value = module.debianservers2.availability_set_id
 }

+output "debian2_vm_names" {
+  value = module.debianservers2.vm_names
+}
+
 output "debian_availability_set_id" {
   value = module.debianservers.availability_set_id
 }
@@ -10,6 +14,10 @@ output "debian_ip_address" {
   value = module.debianservers.public_ip_address
 }

+output "debian_vm_names" {
+  value = module.debianservers.vm_names
+}
+
 output "debian_vm_public_name" {
   value = module.debianservers.public_ip_dns_name
 }
@@ -44,6 +52,10 @@ output "ubuntu_ip_address" {
   value = module.ubuntuservers.public_ip_address
 }

+output "ubuntu_vm_names" {
+  value = module.ubuntuservers.vm_names
+}
+
 output "ubuntu_vm_public_name" {
   value = module.ubuntuservers.public_ip_dns_name
 }
@@ -92,6 +104,10 @@ output "windows_vm_admin_password" {
   value     = local.admin_password
 }

+output "windows_vm_names" {
+  value = module.windowsservers.vm_names
+}
+
 output "windows_vm_public_name" {
   value = module.windowsservers.public_ip_dns_name
-}
+}
\ No newline at end of file
---
outputs.tf
@@ -48,6 +48,14 @@ output "vm_ids" {
   value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

+output "vm_names"   description = "Virtual machine names created."
+  value = {
+    linux   = azurerm_virtual_machine.vm_linux[*].name
+    windows = azurerm_virtual_machine.vm_windows[*].name
+  }
+}
+
 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
   value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
---

---

Choice D:
README.md
@@ -466,5 +466,6 @@ Originally created by [David Tesar](http://github.com/dtzar)
 |  [public\_ip\_id](#output\_public\_ip\_id)                                                   | id of the public ip address provisoned.                                                                                |
 |  [vm\_identity](#output\_vm\_identity)                                                        | map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.                               |
 |  [vm\_ids](#output\_vm\_ids)                                                                       | Virtual machine ids created.                                                                                |
+|  [vm\_names](#output\_vm\_names)                                                                 | Virtual machine names created.                                                                                |
 |  [vm\_zones](#output\_vm\_zones)                                                                 | map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in. |

---
examples/complete/outputs.tf
@@ -2,6 +2,10 @@ output "debian2_availability_set_id" {
   value = module.debianservers2.availability_set_id
 }

+output "debian2_vm_names" {
+  value = module.debianservers2.vm_names
+}
+
 output "debian_availability_set_id" {
   value = module.debianservers.availability_set_id
 }
@@ -10,6 +14,10 @@ output "debian_ip_address" {
   value = module.debianservers.public_ip_address
 }

+output "debian_vm_names" {
+  value = module.debianservers.vm_names
+}
+
 output "debian_vm_public_name" {
   value = module.debianservers.public_ip_dns_name
 }
@@ -44,6 +52,10 @@ output "ubuntu_ip_address" {
   value = module.ubuntuservers.public_ip_address
 }

+output "ubuntu_vm_names" {
+  value = module.ubuntuservers.vm_names
+}
+
 output "ubuntu_vm_public_name" {
   value = module.ubuntuservers.public_ip_dns_name
 }
@@ -92,6 +104,10 @@ output "windows_vm_admin_password" {
   value     = local.admin_password
 }

+output "windows_vm_names" {
+  value = module.windowsservers.vm_names
+}
+
 output "windows_vm_public_name" {
   value = module.windowsservers.public_ip_dns_name
-}
+}
\ No newline at end of file
---
outputs.tf
@@ -48,6 +48,14 @@ output "vm_ids" {
   value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

+output "vm_names" {
+  description = "Virtual machine names created."
+  value = {
+    linux   = azurerm_virtual_machine.vm_linux[*].name
+    windows = azurerm_virtual_machine.vm_windows[*].name
+  }
+}
+
 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
   value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
Fix unused variable issue, add the missing argument back to fix the bug introduced by #189

## Describe your changes

## Issue number

#197

## 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

Thanks for your cooperation!

---

Choice A:
.tflint_alt.hcl
@@ -181,7 +181,7 @@ rule "terraform_typed_variables" {
 }

 rule "terraform_unused_declarations" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_unused_required_providers" {
---
main.tf
@@ -49,9 +49,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -67,6 +65,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
     create_option     = "FromImage"
     name              = "osdisk-${var.vm_hostname}-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -162,9 +161,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -180,6 +177,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
     create_option     = "FromImage"
     name              = "${var.vm_hostname}-osdisk-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -320,10 +318,8 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
-      ""
-    ])), count.index) : ""
-    subnet_id = var.vnet_subnet_id
+    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
+    subnet_id                     = var.vnet_subnet_id
   }
 }

---

---

Choice B:
.tflint_alt.hcl
@@ -181,7 +181,7 @@ rule "terraform_typed_variables" {
 }

 rule "terraform_unused_declarations" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_unused_required_providers" {
---
main.tf
@@ -49,9 +49,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -67,6 +65,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
     create_option     = "FromImage"
     name              = "osdisk-${var.vm_hostname}-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ !contains(tolist([var.vm_os_simple, +161,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -180,6 +177,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
     create_option     = "FromImage"
     name              = "${var.vm_hostname}-osdisk-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -320,10 +318,8 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
-      ""
-    ])), count.index) : ""
-    subnet_id = var.vnet_subnet_id
+    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
+    subnet_id                     = var.vnet_subnet_id
   }
 }

---

---

Choice C:
.tflint_alt.hcl
@@ -181,7 +181,7 @@ rule "terraform_typed_variables" {
 }

 rule "terraform_unused_declarations" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_unused_required_providers" {
---
main.tf
@@ -49,9 +49,7 @@ moved = }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -67,6 +65,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
     create_option     = "FromImage"
     name              = "osdisk-${var.vm_hostname}-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -162,9 +161,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -180,6 +177,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
     create_option     = "FromImage"
     name              = "${var.vm_hostname}-osdisk-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -320,10 +318,8 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
-      ""
-    ])), count.index) : ""
-    subnet_id = var.vnet_subnet_id
+    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
+    subnet_id                     = var.vnet_subnet_id
   }
 }

---

---

Choice D:
.tflint_alt.hcl
@@ -181,7 +181,7 @@ rule "terraform_typed_variables" {
 }

 rule "terraform_unused_declarations" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_unused_required_providers" {
---
main.tf
@@ -49,9 +49,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_linux" {
-  count = !contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0
+  count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && !var.is_windows_image ? var.nb_instances : 0

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
@@ -67,6 +65,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
     create_option     = "FromImage"
     name              = "osdisk-${var.vm_hostname}-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -162,9 +161,7 @@ moved {
 }

 resource "azurerm_virtual_machine" "vm_windows" {
-  count = (var.is_windows_image || contains(tolist([
-    var.vm_os_simple, var.vm_os_offer
-  ]), "WindowsServer")) ? var.nb_instances : 0
+  count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
@@ -180,6 +177,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
     create_option     = "FromImage"
     name              = "${var.vm_hostname}-osdisk-${count.index}"
     caching           = "ReadWrite"
+    disk_size_gb      = var.storage_os_disk_size_gb
     managed_disk_type = var.storage_account_type
   }
   boot_diagnostics {
@@ -320,10 +318,8 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id =  > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
-      ""
-    ])), count.index) : ""
-    subnet_id = var.vnet_subnet_id
+    public_ip_address_id          = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([""])), count.index) : ""
+    subnet_id                     = var.vnet_subnet_id
   }
 }

---

---


Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter.

Task Description:
## Describe your changes

## Issue number

#190

## 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

Thanks for your cooperation!

---

Choice A:
.tflint_alt.hcl
@@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
 }

 rule "terraform_deprecated_index" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_deprecated_interpolation" {
---
main.tf
@@ -55,7 +55,7 @@ resource "azurerm_virtual_machine" "vm_linux" {

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
-  network_interface_ids            = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids            = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name              = var.resource_group_name
   vm_size                          = var.vm_size
   availability_set_id              = azurerm_availability_set.vm.id
@@ -71,7 +71,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -168,7 +168,7 @@ resource "azurerm_virtual_machine" "vm_windows" {

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
-  network_interface_ids         = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids         = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name           = var.resource_group_name
   vm_size                       = var.vm_size
   availability_set_id           = azurerm_availability_set.vm.id
@@ -184,7 +184,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -320,7 +320,7 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-  "vm_linux"  public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
       ""
     ])), count.index) : ""
     subnet_id = var.vnet_subnet_id
---
outputs.tf
@@ -5,12 +5,12 @@ output "availability_set_id" {

 output "network_interface_ids" {
   description = "ids of the vm nics provisoned."
-  value       = azurerm_network_interface.vm.*.id
+  value       = azurerm_network_interface.vm[*].id
 }

 output "network_interface_private_ip" {
   description = "private ip addresses of the vm nics"
-  value       = azurerm_network_interface.vm.*.private_ip_address
+  value       = azurerm_network_interface.vm[*].private_ip_address
 }

 output "network_security_group_id" {
@@ -25,30 +25,30 @@ output "network_security_group_name" {

 output "public_ip_address" {
   description = "The actual ip address allocated for the resource."
-  value       = data.azurerm_public_ip.vm.*.ip_address
+  value       = data.azurerm_public_ip.vm[*].ip_address
 }

 output "public_ip_dns_name" {
   description = "fqdn to connect to the first vm provisioned."
-  value       = azurerm_public_ip.vm.*.fqdn
+  value       = azurerm_public_ip.vm[*].fqdn
 }

 output "public_ip_id" {
   description = "id of the public ip address provisoned."
-  value       = azurerm_public_ip.vm.*.id
+  value       = azurerm_public_ip.vm[*].id
 }

 output "vm_identity" {
   description = "map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine."
-  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows.*.identity, azurerm_virtual_machine.vm_linux.*.identity))
+  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows[*].identity, azurerm_virtual_machine.vm_linux[*].identity))
 }

 output "vm_ids" {
   description = "Virtual machine ids created."
-  value       = concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id)
+  value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
-  value       = zipmap(concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id), concat(azurerm_virtual_machine.vm_windows.*.zones, azurerm_virtual_machine.vm_linux.*.zones))
+  value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
 }
\ No newline at end of file
---

---

Choice B:
.tflint_alt.hcl
@@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
 }

 rule "terraform_deprecated_index" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_deprecated_interpolation" {
---
main.tf
@@ -55,7 +55,7 @@ resource "azurerm_virtual_machine" "vm_linux" {

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
-  network_interface_ids            = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids            = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name   key           = var.resource_group_name
   vm_size                          = var.vm_size
   availability_set_id              = azurerm_availability_set.vm.id
@@ -71,7 +71,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -168,7 +168,7 @@ resource "azurerm_virtual_machine" "vm_windows" {

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
-  network_interface_ids         = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids         = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name           = var.resource_group_name
   vm_size                       = var.vm_size
   availability_set_id           = azurerm_availability_set.vm.id
@@ -184,7 +184,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -320,7 +320,7 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
       ""
     ])), count.index) : ""
     subnet_id = var.vnet_subnet_id
---
outputs.tf
@@ -5,12 +5,12 @@ output "availability_set_id" {

 output "network_interface_ids" {
   description = "ids of the vm nics provisoned."
-  value       = azurerm_network_interface.vm.*.id
+  value       = azurerm_network_interface.vm[*].id
 }

 output "network_interface_private_ip" {
   description = "private ip addresses of the vm nics"
-  value       = azurerm_network_interface.vm.*.private_ip_address
+  value       = azurerm_network_interface.vm[*].private_ip_address
 }

 output "network_security_group_id" {
@@ -25,30 +25,30 @@ output "network_security_group_name" {

 output "public_ip_address" {
   description = "The actual ip address allocated for the resource."
-  value       = data.azurerm_public_ip.vm.*.ip_address
+  value       = data.azurerm_public_ip.vm[*].ip_address
 }

 output "public_ip_dns_name" {
   description = "fqdn to connect to the first vm provisioned."
-  value       = azurerm_public_ip.vm.*.fqdn
+  value       = azurerm_public_ip.vm[*].fqdn
 }

 output "public_ip_id" {
   description = "id of the public ip address provisoned."
-  value       = azurerm_public_ip.vm.*.id
+  value       = azurerm_public_ip.vm[*].id
 }

 output "vm_identity" {
   description = "map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine."
-  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows.*.identity, azurerm_virtual_machine.vm_linux.*.identity))
+  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows[*].identity, azurerm_virtual_machine.vm_linux[*].identity))
 }

 output "vm_ids" {
   description = "Virtual machine ids created."
-  value       = concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id)
+  value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
-  value       = zipmap(concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id), concat(azurerm_virtual_machine.vm_windows.*.zones, azurerm_virtual_machine.vm_linux.*.zones))
+  value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
 }
\ No newline at end of file
---

---

Choice C:
.tflint_alt.hcl
@@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
 }

 rule "terraform_deprecated_index" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_deprecated_interpolation" {
---
main.tf
@@ -55,7 +55,7 @@ resource "azurerm_virtual_machine" "vm_linux" {

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
-  network_interface_ids            = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids            = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name              = var.resource_group_name
   vm_size                          = var.vm_size
   availability_set_id              = azurerm_availability_set.vm.id
@@ -71,7 +71,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -168,7 +168,7 @@ resource "azurerm_virtual_machine" "vm_windows" {

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
-  network_interface_ids         = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids         = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name           = var.resource_group_name
   vm_size                       = var.vm_size
   availability_set_id           = azurerm_availability_set.vm.id
@@ -184,7 +184,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -320,7 +320,7 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
       ""
     ])), count.index) : ""
     subnet_id = var.vnet_subnet_id
---
outputs.tf
@@ -5,12 +5,12 @@ output "availability_set_id" {

 output "network_interface_ids" {
   description = "ids of the vm nics provisoned."
-  value       = azurerm_network_interface.vm.*.id
+  value       = azurerm_network_interface.vm[*].id
 }

 output "network_interface_private_ip" {
   description = "private ip addresses of the vm nics"
-  value       = azurerm_network_interface.vm.*.private_ip_address
+  value       = azurerm_network_interface.vm[*].private_ip_address
 }

 output "network_security_group_id" {
@@ -25,30 +25,30 @@ output "network_security_group_name" {

 output "public_ip_address" {
   description = "The actual ip address allocated for the resource."
-  value       = data.azurerm_public_ip.vm.*.ip_address
+  value       = data.azurerm_public_ip.vm[*].ip_address
 }

 output "public_ip_dns_name" {
   description = "fqdn to connect to the first vm provisioned."
-  value       = azurerm_public_ip.vm.*.fqdn
+  value       = azurerm_public_ip.vm[*].fqdn
 }

 output "public_ip_id" {
   description = "id of the public ip address provisoned."
-  value       = azurerm_public_ip.vm.*.id
+  value       = azurerm_public_ip.vm[*].id
 }

 output "vm_identity" {
   description = "map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine."
-  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows.*.identity, azurerm_virtual_machine.vm_linux.*.identity))
+  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows[*].identity, azurerm_virtual_machine.vm_linux[*].identity))
 }

 output "vm_ids" {
   description = "Virtual machine ids created."
-  value       = concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id)
+  value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
-  value       = zipmap(concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id), concat(azurerm_virtual_machine.vm_windows.*.zones, azurerm_virtual_machine.vm_linux.*.zones))
+  value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
 }
\ No newline at end of file
---

---

Choice D:
.tflint_alt.hcl
@@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
 }

 rule "terraform_deprecated_index" {
-  enabled = false
+  enabled = true
 }

 rule "terraform_deprecated_interpolation" {
---
main.tf
@@ -55,7 +55,7 @@ resource "azurerm_virtual_machine" "vm_linux" {

   location                         = local.location
   name                             = "${var.vm_hostname}-vmLinux-${count.index}"
-  network_interface_ids            = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids            = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name              = var.resource_group_name
   vm_size                          = var.vm_size
   availability_set_id              = azurerm_availability_set.vm.id
@@ -71,7 +71,7 @@ resource "azurerm_virtual_machine" "vm_linux" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -168,7 +168,7 @@ resource "azurerm_virtual_machine" "vm_windows" {

   location                      = local.location
   name                          = "${var.vm_hostname}-vmWindows-${count.index}"
-  network_interface_ids         = [element(azurerm_network_interface.vm.*.id, count.index)]
+  network_interface_ids         = [element(azurerm_network_interface.vm[*].id, count.index)]
   resource_group_name           = var.resource_group_name
   vm_size                       = var.vm_size
   availability_set_id           = azurerm_availability_set.vm.id
@@ -184,7 +184,7 @@ resource "azurerm_virtual_machine" "vm_windows" {
   }
   boot_diagnostics {
     enabled     = var.boot_diagnostics
-    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa.*.primary_blob_endpoint) : ""
+    storage_uri = var.boot_diagnostics ? join(",", azurerm_storage_account.vm_sa[*].primary_blob_endpoint) : ""
   }
   dynamic "identity" {
     for_each = length(var.identity_ids) == 0 && var.identity_type == "SystemAssigned" ? [var.identity_type] : []
@@ -320,7 +320,7 @@ resource "azurerm_network_interface" "vm" {
   ip_configuration {
     name                          = "${var.vm_hostname}-ip-${count.index}"
     private_ip_address_allocation = "Dynamic"
-    public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([
+    public_ip_address_id = length(azurerm_public_ip.vm[*].id) > 0 ? element(concat(azurerm_public_ip.vm[*].id, tolist([
       ""
     ])), count.index) : ""
     subnet_id = var.vnet_subnet_id
---
outputs.tf
@@ -5,12 +5,12 @@ output "availability_set_id" {

 output "network_interface_ids" {
   description = "ids of the vm nics provisoned."
-  value       = azurerm_network_interface.vm.*.id
+  value       = azurerm_network_interface.vm[*].id
 }

 output "network_interface_private_ip" {
   description = "private ip addresses of the vm nics"
-  value       = azurerm_network_interface.vm.*.private_ip_address
+  value       = azurerm_network_interface.vm[*].private_ip_address
 }

 output "network_security_group_id" {
@@ -25,30 +25,30 @@ output "network_security_group_name" {

 output "public_ip_address" {
   description = "The actual ip address allocated for the resource."
-  value       = data.azurerm_public_ip.vm.*.ip_address
+  value       = data.azurerm_public_ip.vm[*].ip_address
 }

 output "public_ip_dns_name" {
   description = "fqdn to connect to the first vm provisioned."
-  value       = azurerm_public_ip.vm.*.fqdn
+  value       = azurerm_public_ip.vm[*].fqdn
 }

 output "public_ip_id" {
   description = "id of the public ip address provisoned."
-  value       = azurerm_public_ip.vm.*.id
+  value       = azurerm_public_ip.vm[*].id
 }

 output "vm_identity" {
   description = "map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine."
-  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows.*.identity, azurerm_virtual_machine.vm_linux.*.identity))
+  value       = zipmap(concat([for m in azurerm_virtual_machine.vm_windows : m.id], [for m in azurerm_virtual_machine.vm_linux : m.id]), concat(azurerm_virtual_machine.vm_windows[*].identity, azurerm_virtual_machine.vm_linux[*].identity))
 }

 output "vm_ids" {
   description = "Virtual machine ids created."
-  value       = concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id)
+  value       = concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id)
 }

 output "vm_zones" {
   description = "map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in."
-  value       = zipmap(concat(azurerm_virtual_machine.vm_windows.*.id, azurerm_virtual_machine.vm_linux.*.id), concat(azurerm_virtual_machine.vm_windows.*.zones, azurerm_virtual_machine.vm_linux.*.zones))
+  value       = zipmap(concat(azurerm_virtual_machine.vm_windows[*].id, azurerm_virtual_machine.vm_linux[*].id), concat(azurerm_virtual_machine.vm_windows[*].zones, azurerm_virtual_machine.vm_linux[*].zones))
 }
\ No newline at end of file
---

---