Update main.tf

This commit is contained in:
2025-09-11 16:48:27 -07:00
parent 159c023eaa
commit be2a65d719

View File

@@ -20,6 +20,10 @@ resource "google_compute_firewall" "yunohost_allow" {
target_tags = ["yunohost"]
}
resource "google_compute_address" "static_ip" {
name = "yunohost-static-ip"
}
resource "google_compute_instance" "yunohost" {
name = "yunohost"
machine_type = "e2-small"
@@ -34,7 +38,9 @@ resource "google_compute_instance" "yunohost" {
}
network_interface {
network = "default"
access_config {}
access_config {
nat_ip = google_compute_address.static_ip.address
}
}
metadata = {
startup-script = file("${path.module}/startup.sh")
@@ -45,3 +51,4 @@ resource "google_compute_instance" "yunohost" {
output "external_ip" {
value = google_compute_instance.yunohost.network_interface[0].access_config[0].nat_ip
}