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" {
|
resource "azurerm_resource_group" "example" {
|
||||||
name = "${var.name_prefix}-rg"
|
name = "${random_pet.rg_name.id}-rg"
|
||||||
location = var.location
|
location = var.location
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_managed_disk" "example" {
|
resource "azurerm_managed_disk" "main" {
|
||||||
name = "${var.name_prefix}-disk"
|
name = "${random_pet.rg_name.id}-disk"
|
||||||
location = azurerm_resource_group.example.location
|
location = azurerm_resource_group.example.location
|
||||||
resource_group_name = azurerm_resource_group.example.name
|
resource_group_name = azurerm_resource_group.example.name
|
||||||
storage_account_type = "Standard_LRS"
|
storage_account_type = "Standard_LRS"
|
||||||
@ -22,3 +22,7 @@ resource "azurerm_managed_disk" "example" {
|
|||||||
|
|
||||||
security_type = "ConfidentialVM_DiskEncryptedWithPlatformKey"
|
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,11 +4,11 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
azurerm = {
|
azurerm = {
|
||||||
source = "hashicorp/azurerm"
|
source = "hashicorp/azurerm"
|
||||||
version = "~>3.8"
|
version = ">= 3.0, < 4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
provider "azurerm" {
|
provider "azurerm" {
|
||||||
features {}
|
features {}
|
||||||
}
|
}
|
@ -1,9 +1,11 @@
|
|||||||
variable "location" {
|
variable "location" {
|
||||||
type = string
|
type = string
|
||||||
|
default = "westus"
|
||||||
description = "Location where resources will be created"
|
description = "Location where resources will be created"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "name_prefix" {
|
variable "name_prefix" {
|
||||||
type = string
|
type = string
|
||||||
|
default = "201-confidential-os-disk"
|
||||||
description = "Prefix of the resource name"
|
description = "Prefix of the resource name"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user