Working Landing Zone.

This commit is contained in:
2025-03-30 11:31:28 +02:00
commit a427e31bb6
10 changed files with 216 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
resource "google_compute_instance" "vm_hub" {
name = var.name
machine_type = var.machine_type
can_ip_forward = var.can_ip_forward
description = var.description
boot_disk {
initialize_params {
image = "debian-cloud/debian-12"
}
}
network_interface {
network = var.network_name
subnetwork = var.subnet_name
}
metadata = {
ssh-keys = "${var.ssh[0].public_key} ${var.ssh[0].ssh_user}"
}
}
+3
View File
@@ -0,0 +1,3 @@
output "vm_internal_ip" {
value = google_compute_instance.vm_hub.network_interface[0].network_ip
}
+41
View File
@@ -0,0 +1,41 @@
variable "name" {
description = "The name of the VM instance."
type = string
}
variable "machine_type" {
description = "The machine type of the VM instance."
type = string
default = "e2-micro"
}
variable "can_ip_forward" {
description = "Whether the VM instance can forward IP packets."
type = bool
default = false
}
variable "description" {
description = "The description of the VM instance."
type = string
nullable = true
default = null
}
variable "network_name" {
description = "The name of the network to attach the VM instance to."
type = string
}
variable "subnet_name" {
description = "The name of the subnet to attach the VM instance to."
type = string
}
variable "ssh" {
description = "SSH Key(s) definition"
type = list(object({
public_key = string
ssh_user = string
}))
}