201-confidential-os-disk patch (#141)
* add default value for variables; add random string for rgn
This commit is contained in:
parent
dd30e9384e
commit
6baa9203b7
@ -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
|
||||
}
|
7
quickstart/201-confidential-os-disk/outputs.tf
Normal file
7
quickstart/201-confidential-os-disk/outputs.tf
Normal file
@ -0,0 +1,7 @@
|
||||
output "resource_group_name" {
|
||||
value = azurerm_resource_group.example.name
|
||||
}
|
||||
|
||||
output "managed_disk_name" {
|
||||
value = azurerm_managed_disk.main.name
|
||||
}
|
@ -4,7 +4,7 @@ terraform {
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~>3.8"
|
||||
version = ">= 3.0, < 4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user