Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add secure_boot_enabled and vtpm_enabled options #1825

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

olandese
Copy link
Contributor

Description

Add secure_boot_enabled and vtpm_enabled options in Windows and Linux VMs

Does this introduce a breaking change

  • YES
  • NO

Testing

Create a VM with the options enabled like:

global_settings = {
  default_region = "region1"
  regions = {
    region1 = "westeurope"
  }
}

resource_groups = {
  vm_region1 = {
    name = "example-virtual-machine-olandese"
  }
}

virtual_machines = {

  domain_controller_1_vm = {

    resource_group = {
      key = "vm_region1"
    }

    provision_vm_agent                   = true
    boot_diagnostics_storage_account_key = ""
    os_type                              = "windows"

    keyvault_key = "example_vm_rg1"

    networking_interfaces = {
      nic0 = {
        # Value of the keys from networking.tfvars
        vnet_key                = "vnet_region1"
        subnet_key              = "example"
        name                    = "0"
        enable_ip_forwarding    = false
        internal_dns_name_label = "nic0"
      }
    }

    data_disks = {
      vm-wl-addc-datadisk = {
        name                 = "data01-vm-wl-addc-p1"
        storage_account_type = "Premium_LRS"
        create_option        = "Empty"
        disk_size_gb         = "32"
        lun                  = 0
        caching              = "ReadWrite"
        # Choose the zone in which this first vm resides
        zone = 2
      }
    }

    virtual_machine_settings = {
      windows = {
        name                            = "wl-addc-p1"
        size                            = "Standard_B2ms"
        admin_username                  = "adminuser"
        disable_password_authentication = true
        zone                            = 2

        patch_mode          = "AutomaticByPlatform"
        hotpatching_enabled = false

        # MUST BE TRUE!
        encryption_at_host_enabled = false

        # Value of the nic keys to attach the VM. The first one in the list is the default nic
        network_interface_keys = ["nic0"]

        identity = {
          type = "SystemAssigned"
        }

        os_disk = {
          name                 = "os-vm-wl-addc-p1"
          disk_size_gb         = "64"
          caching              = "ReadWrite"
          storage_account_type = "Premium_LRS"
          zone                 = 2
        }

        source_image_reference = {
          publisher = "MicrosoftWindowsServer"
          offer     = "WindowsServer"
          sku       = "2022-datacenter-azure-edition-hotpatch-smalldisk"
          version   = "latest"
        }

        secure_boot_enabled = true
        vtpm_enabled = true
      }
    }
  }
}

Copy link
Member

@arnaudlh arnaudlh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arnaudlh arnaudlh added enhancement New feature or request virtual machines labels Oct 17, 2023
@arnaudlh arnaudlh added this to the 5.7.6 milestone Oct 17, 2023
@arnaudlh arnaudlh merged commit 5bb7887 into aztfmod:main Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request virtual machines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants