diff --git a/quickstart/201-confidential-os-disk/main.tf b/quickstart/201-confidential-os-disk/main.tf index 2060fc8a..ae4d2402 100644 --- a/quickstart/201-confidential-os-disk/main.tf +++ b/quickstart/201-confidential-os-disk/main.tf @@ -6,12 +6,12 @@ data "azurerm_platform_image" "example" { } resource "azurerm_resource_group" "example" { - name = "${var.name_prefix}-rg" + name = "${random_pet.rg_name.id}-rg" location = var.location } -resource "azurerm_managed_disk" "example" { - name = "${var.name_prefix}-disk" +resource "azurerm_managed_disk" "main" { + name = "${random_pet.rg_name.id}-disk" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name storage_account_type = "Standard_LRS" @@ -22,3 +22,7 @@ resource "azurerm_managed_disk" "example" { security_type = "ConfidentialVM_DiskEncryptedWithPlatformKey" } + +resource "random_pet" "rg_name" { + prefix = var.name_prefix +} \ No newline at end of file diff --git a/quickstart/201-confidential-os-disk/outputs.tf b/quickstart/201-confidential-os-disk/outputs.tf new file mode 100644 index 00000000..ab450506 --- /dev/null +++ b/quickstart/201-confidential-os-disk/outputs.tf @@ -0,0 +1,7 @@ +output "resource_group_name" { + value = azurerm_resource_group.example.name +} + +output "managed_disk_name" { + value = azurerm_managed_disk.main.name +} \ No newline at end of file diff --git a/quickstart/201-confidential-os-disk/providers.tf b/quickstart/201-confidential-os-disk/providers.tf index 6b2a6509..549f9c0c 100644 --- a/quickstart/201-confidential-os-disk/providers.tf +++ b/quickstart/201-confidential-os-disk/providers.tf @@ -4,11 +4,11 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~>3.8" + version = ">= 3.0, < 4.0" } } } provider "azurerm" { features {} -} +} \ No newline at end of file diff --git a/quickstart/201-confidential-os-disk/variables.tf b/quickstart/201-confidential-os-disk/variables.tf index d0d1cc7c..4fefba47 100644 --- a/quickstart/201-confidential-os-disk/variables.tf +++ b/quickstart/201-confidential-os-disk/variables.tf @@ -1,9 +1,11 @@ variable "location" { type = string + default = "westus" description = "Location where resources will be created" } variable "name_prefix" { type = string + default = "201-confidential-os-disk" description = "Prefix of the resource name" -} +} \ No newline at end of file