Add examples for confidential VM, VMSS and OS Disk
This commit is contained in:
24
quickstart/201-confidential-os-disk/main.tf
Normal file
24
quickstart/201-confidential-os-disk/main.tf
Normal file
@ -0,0 +1,24 @@
|
||||
data "azurerm_platform_image" "example" {
|
||||
location = var.location
|
||||
publisher = "MicrosoftWindowsServer"
|
||||
offer = "windows-cvm"
|
||||
sku = "2022-datacenter-cvm"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "example" {
|
||||
name = "${var.name_prefix}-rg"
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "azurerm_managed_disk" "example" {
|
||||
name = "${var.name_prefix}-disk"
|
||||
location = azurerm_resource_group.example.location
|
||||
resource_group_name = azurerm_resource_group.example.name
|
||||
storage_account_type = "Standard_LRS"
|
||||
create_option = "FromImage"
|
||||
image_reference_id = data.azurerm_platform_image.example.id
|
||||
os_type = "Windows"
|
||||
hyper_v_generation = "V2"
|
||||
|
||||
security_type = "ConfidentialVM_DiskEncryptedWithPlatformKey"
|
||||
}
|
14
quickstart/201-confidential-os-disk/provider.tf
Normal file
14
quickstart/201-confidential-os-disk/provider.tf
Normal file
@ -0,0 +1,14 @@
|
||||
terraform {
|
||||
required_version = ">=1.0"
|
||||
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~>3.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
19
quickstart/201-confidential-os-disk/readme.md
Normal file
19
quickstart/201-confidential-os-disk/readme.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Azure confidential os disk
|
||||
|
||||
This template deploys an Azure confidential os disk encrypted by platform key.
|
||||
|
||||
## Resources
|
||||
|
||||
- [azurerm_managed_disk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_disk)
|
||||
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
|
||||
|
||||
## Variables
|
||||
|
||||
| Name | Description |
|
||||
|-|-|
|
||||
| `location` | (Required) Azure Region in which to deploy these resources.|
|
||||
| `name_prefix` | (Optional) Prefix of the resource name. Value defaults to: tftest|
|
||||
|
||||
## Example
|
||||
|
||||
To see how to run this example, see [Create an Azure confidential os disk using Terraform](https://docs.microsoft.com/azure/developer/terraform/create-confidential-os-disk).
|
10
quickstart/201-confidential-os-disk/variables.tf
Normal file
10
quickstart/201-confidential-os-disk/variables.tf
Normal file
@ -0,0 +1,10 @@
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "Location where resources will be created"
|
||||
}
|
||||
|
||||
variable "name_prefix" {
|
||||
type = string
|
||||
default = "tftest"
|
||||
description = "Prefix of the resource name"
|
||||
}
|
Reference in New Issue
Block a user