the existing infrastructure
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Illustrative only: swap in vsphere_virtual_machine, proxmox_vm_qemu,
|
||||
# kubevirt_virtual_machine or a cloud provider's instance resource.
|
||||
resource "terraform_data" "vm" {
|
||||
input = {
|
||||
name = "${var.environment}-${var.name}"
|
||||
template = var.template
|
||||
cpu = var.cpu
|
||||
memory_mb = var.memory_gb * 1024
|
||||
disks = var.disks
|
||||
vlan = var.vlan
|
||||
ip = var.ip
|
||||
backup_policy = var.backup_policy
|
||||
tags = var.tags
|
||||
}
|
||||
}
|
||||
|
||||
output "id" { value = terraform_data.vm.id }
|
||||
@@ -0,0 +1,24 @@
|
||||
variable "name" { type = string }
|
||||
variable "environment" { type = string }
|
||||
variable "template" { type = string }
|
||||
variable "cpu" { type = number }
|
||||
variable "memory_gb" { type = number }
|
||||
variable "disks" {
|
||||
type = list(object({
|
||||
size_gb = number
|
||||
tier = optional(string, "standard")
|
||||
}))
|
||||
}
|
||||
variable "vlan" { type = number }
|
||||
variable "ip" {
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
variable "backup_policy" {
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
variable "tags" {
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
Reference in New Issue
Block a user