Skip to content

Commit e8a4895

Browse files
jchancellor-msIliassAKIlias Akarkachjaredfholgate
authored
V0.20.0 - Features and fixes (#195)
* Added existing disk attach * precommit * Added vm_agent_platform_updates_enabled to ignore_changes (#190) Co-authored-by: Ilias Akarkach <ilias.akarkach@wortell.nl> * precommit * maint config to azapi * Added existing disk attach * Added vm_agent_platform_updates_enabled to ignore_changes (#190) Co-authored-by: Ilias Akarkach <ilias.akarkach@wortell.nl> * precommit * initial backup submodule (w/errors) * backup module fixed and pre-commit * pre-commit * pre-commit * linting * enable encryption at host * add azapi * attempt to fix tests * bin bastion ad try fixing region * azapi rsv * removed backup from gallery test * serializing nic assoc * serialized associations --------- Co-authored-by: IAKA <36501350+IliassAK@users.noreply.github.com> Co-authored-by: Ilias Akarkach <ilias.akarkach@wortell.nl> Co-authored-by: Jared Holgate <jaredholgate@microsoft.com>
1 parent da7b45c commit e8a4895

58 files changed

Lines changed: 803 additions & 197 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ crash.log
1010
crash.*.log
1111

1212
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
13-
# password, private keys, and other secrets. These should not be part of version
14-
# control as they are data points which are potentially sensitive and subject
13+
# password, private keys, and other secrets. These should not be part of version
14+
# control as they are data points which are potentially sensitive and subject
1515
# to change depending on the environment.
1616
*.tfvars
1717
*.tfvars.json
@@ -47,5 +47,6 @@ avmmakefile
4747
avm.tflint_module.hcl
4848
avm.tflint_module.merged.hcl
4949
examples/*/policy
50+
*.cache
5051
*.mptfbackup
5152
.avm

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is the virtual machine resource module for the Azure Verified Modules libra
1111

1212
The following requirements are needed by this module:
1313

14-
- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.9, < 2.0)
14+
- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.10, < 2.0)
1515

1616
- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.4)
1717

@@ -28,11 +28,11 @@ The following requirements are needed by this module:
2828
The following resources are used by this module:
2929

3030
- [azapi_resource.this_backup_intent](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) (resource)
31+
- [azapi_resource.this_maintenance_configuration_assignment](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) (resource)
3132
- [azurerm_dev_test_global_vm_shutdown_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/dev_test_global_vm_shutdown_schedule) (resource)
3233
- [azurerm_key_vault_secret.admin_password](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) (resource)
3334
- [azurerm_key_vault_secret.admin_ssh_key](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) (resource)
3435
- [azurerm_linux_virtual_machine.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine) (resource)
35-
- [azurerm_maintenance_assignment_virtual_machine.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/maintenance_assignment_virtual_machine) (resource)
3636
- [azurerm_managed_disk.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_disk) (resource)
3737
- [azurerm_management_lock.this_disk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_lock) (resource)
3838
- [azurerm_management_lock.this_linux_virtualmachine](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_lock) (resource)
@@ -53,7 +53,9 @@ The following resources are used by this module:
5353
- [azurerm_role_assignment.this_network_interface](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource)
5454
- [azurerm_role_assignment.this_virtual_machine](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource)
5555
- [azurerm_virtual_machine_data_disk_attachment.this_linux](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_machine_data_disk_attachment) (resource)
56+
- [azurerm_virtual_machine_data_disk_attachment.this_linux_existing](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_machine_data_disk_attachment) (resource)
5657
- [azurerm_virtual_machine_data_disk_attachment.this_windows](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_machine_data_disk_attachment) (resource)
58+
- [azurerm_virtual_machine_data_disk_attachment.this_windows_existing](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_machine_data_disk_attachment) (resource)
5759
- [azurerm_windows_virtual_machine.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_virtual_machine) (resource)
5860
- [modtm_telemetry.telemetry](https://registry.terraform.io/providers/Azure/modtm/latest/docs/resources/telemetry) (resource)
5961
- [random_password.admin_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) (resource)
@@ -520,6 +522,30 @@ Type: `string`
520522

521523
Default: `null`
522524

525+
### <a name="input_data_disk_existing_disks"></a> [data\_disk\_existing\_disks](#input\_data\_disk\_existing\_disks)
526+
527+
Description: A map of objects used to define one or more existing data disks for attachment to the virtual machine. This will not create the disks but will instead attach previously created disks to the virtual machine using their resource Ids. Lun numbers need to be unique across all disks include disks created as part of the module.
528+
- `<map key>` - Use a custom map key to define each data disk
529+
- `caching` (Required) - Specifies the caching requirements for this Data Disk. Possible values include None, ReadOnly and ReadWrite
530+
- `lun` (Required) - The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
531+
- `managed_disk_resource_id` (Required) - The Azure Resource ID of the existing Managed Disk to attach to the Virtual Machine. Changing this forces a new resource to be created.
532+
- `disk_attachment_create_option` (Optional) - The disk attachment create Option of the Data Disk, such as Empty or Attach. Defaults to Attach. Changing this forces a new resource to be created.
533+
- `write_accelerator_enabled` (Optional) - Should Write Accelerator be enabled for this Data Disk? Defaults to false. Changing this forces a new resource to be created.
534+
535+
Type:
536+
537+
```hcl
538+
map(object({
539+
caching = string
540+
managed_disk_resource_id = string
541+
lun = number
542+
disk_attachment_create_option = optional(string, "Attach")
543+
write_accelerator_enabled = optional(bool, false)
544+
}))
545+
```
546+
547+
Default: `{}`
548+
523549
### <a name="input_data_disk_managed_disks"></a> [data\_disk\_managed\_disks](#input\_data\_disk\_managed\_disks)
524550

525551
Description: This variable is a map of objects used to define one or more data disks for creation and attachment to the virtual machine.
@@ -1375,8 +1401,7 @@ The following arguments are supported:
13751401
- `error_blob_uri` (Optional): Specifies the Azure storage blob where script error stream will be uploaded.
13761402
- `output_blob_managed_identity` (Optional): An output\_blob\_managed\_identity block as defined below. User-assigned managed Identity that has access to outputBlobUri storage blob.
13771403
- `output_blob_uri` (Optional): Specifies the Azure storage blob where script output stream will be uploaded. It can be basic blob URI with SAS token.
1378-
- `parameter` (Optional): A list of parameter blocks as defined below. The parameters used by the script.
1379-
- `protected_parameter` (Optional): A list of protected\_parameter blocks as defined below. The protected parameters used by the script.
1404+
- `parameter` (Optional): A list of parameter blocks as defined below. The parameters used by the script. If sensitive values are required, use the `run_commands_secrets` variable and ensure the map keys match.
13801405
- `timeouts` (Optional): Timeouts for each run command.
13811406
- `tags` (Optional): A mapping of tags which should be assigned to the Virtual Machine Run Command.
13821407

examples/linux_default/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ terraform {
2121
required_version = ">= 1.9, < 2.0"
2222
2323
required_providers {
24+
azapi = {
25+
source = "azure/azapi"
26+
version = "~> 2.0"
27+
}
2428
azurerm = {
2529
source = "hashicorp/azurerm"
2630
version = ">= 3.116, < 5.0"
@@ -237,6 +241,8 @@ The following requirements are needed by this module:
237241

238242
- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.9, < 2.0)
239243

244+
- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0)
245+
240246
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.116, < 5.0)
241247

242248
- <a name="requirement_random"></a> [random](#requirement\_random) (~> 3.7)
@@ -245,6 +251,7 @@ The following requirements are needed by this module:
245251

246252
The following resources are used by this module:
247253

254+
- [azapi_update_resource.allow_drop_unencrypted_vnet](https://registry.terraform.io/providers/azure/azapi/latest/docs/resources/update_resource) (resource)
248255
- [azurerm_resource_group.this_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) (resource)
249256
- [random_integer.region_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource)
250257
- [random_integer.zone_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource)

examples/linux_default/features.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "azapi_update_resource" "allow_drop_unencrypted_vnet" {
2+
resource_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}/providers/Microsoft.Features/featureProviders/Microsoft.Compute/subscriptionFeatureRegistrations/EncryptionAtHost"
3+
type = "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations@2021-07-01"
4+
body = {
5+
properties = {}
6+
}
7+
}

examples/linux_default/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ terraform {
22
required_version = ">= 1.9, < 2.0"
33

44
required_providers {
5+
azapi = {
6+
source = "azure/azapi"
7+
version = "~> 2.0"
8+
}
59
azurerm = {
610
source = "hashicorp/azurerm"
711
version = ">= 3.116, < 5.0"

examples/linux_ubuntu_w_ssh_auth/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ terraform {
2525
required_version = ">= 1.9, < 2.0"
2626
2727
required_providers {
28+
azapi = {
29+
source = "azure/azapi"
30+
version = "~> 2.0"
31+
}
2832
azurerm = {
2933
source = "hashicorp/azurerm"
3034
version = ">= 3.116, < 5.0"
@@ -392,6 +396,8 @@ The following requirements are needed by this module:
392396

393397
- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.9, < 2.0)
394398

399+
- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0)
400+
395401
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.116, < 5.0)
396402

397403
- <a name="requirement_random"></a> [random](#requirement\_random) (~> 3.7)
@@ -402,6 +408,7 @@ The following requirements are needed by this module:
402408

403409
The following resources are used by this module:
404410

411+
- [azapi_update_resource.allow_drop_unencrypted_vnet](https://registry.terraform.io/providers/azure/azapi/latest/docs/resources/update_resource) (resource)
405412
- [azurerm_disk_encryption_set.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/disk_encryption_set) (resource)
406413
- [azurerm_key_vault_secret.admin_ssh_key](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) (resource)
407414
- [azurerm_key_vault_secret.admin_ssh_key_2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) (resource)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "azapi_update_resource" "allow_drop_unencrypted_vnet" {
2+
resource_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}/providers/Microsoft.Features/featureProviders/Microsoft.Compute/subscriptionFeatureRegistrations/EncryptionAtHost"
3+
type = "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations@2021-07-01"
4+
body = {
5+
properties = {}
6+
}
7+
}

examples/linux_ubuntu_w_ssh_auth/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ terraform {
22
required_version = ">= 1.9, < 2.0"
33

44
required_providers {
5+
azapi = {
6+
source = "azure/azapi"
7+
version = "~> 2.0"
8+
}
59
azurerm = {
610
source = "hashicorp/azurerm"
711
version = ">= 3.116, < 5.0"

examples/linux_ubuntu_with_autogen_password/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ terraform {
2323
required_version = ">= 1.9, < 2.0"
2424
2525
required_providers {
26+
azapi = {
27+
source = "azure/azapi"
28+
version = "~> 2.0"
29+
}
2630
azurerm = {
2731
source = "hashicorp/azurerm"
2832
version = ">= 3.116, < 5.0"
@@ -59,8 +63,7 @@ module "regions" {
5963
}
6064
6165
locals {
62-
#deployment_region = module.regions.regions[random_integer.region_index.result].name
63-
deployment_region = "canadacentral" #temporarily pinning on single region
66+
deployment_region = module.regions.regions[random_integer.region_index.result].name
6467
tags = {
6568
scenario = "Default"
6669
}
@@ -268,6 +271,8 @@ The following requirements are needed by this module:
268271

269272
- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.9, < 2.0)
270273

274+
- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0)
275+
271276
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.116, < 5.0)
272277

273278
- <a name="requirement_random"></a> [random](#requirement\_random) (~> 3.7)
@@ -276,6 +281,7 @@ The following requirements are needed by this module:
276281

277282
The following resources are used by this module:
278283

284+
- [azapi_update_resource.allow_drop_unencrypted_vnet](https://registry.terraform.io/providers/azure/azapi/latest/docs/resources/update_resource) (resource)
279285
- [azurerm_resource_group.this_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) (resource)
280286
- [azurerm_user_assigned_identity.example_identity](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/user_assigned_identity) (resource)
281287
- [random_integer.region_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "azapi_update_resource" "allow_drop_unencrypted_vnet" {
2+
resource_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}/providers/Microsoft.Features/featureProviders/Microsoft.Compute/subscriptionFeatureRegistrations/EncryptionAtHost"
3+
type = "Microsoft.Features/featureProviders/subscriptionFeatureRegistrations@2021-07-01"
4+
body = {
5+
properties = {}
6+
}
7+
}

0 commit comments

Comments
 (0)