mirror of
https://github.com/multipleof4/git.planetrenox.com.git
synced 2026-01-13 16:07:55 +00:00
52 lines
1.1 KiB
HCL
52 lines
1.1 KiB
HCL
data "google_compute_image" "fedora" {
|
|
family = "fedora-cloud-41"
|
|
project = "fedora-cloud"
|
|
}
|
|
|
|
resource "google_project_service" "compute" {
|
|
project = var.project_id
|
|
service = "compute.googleapis.com"
|
|
disable_on_destroy = false
|
|
}
|
|
|
|
resource "google_compute_firewall" "gitea_allow" {
|
|
name = "allow-gitea-3000-ssh"
|
|
network = "default"
|
|
direction = "INGRESS"
|
|
allow {
|
|
protocol = "tcp"
|
|
ports = ["22", "3000"]
|
|
}
|
|
source_ranges = ["0.0.0.0/0"]
|
|
target_tags = ["gitea"]
|
|
}
|
|
|
|
resource "google_compute_instance" "gitea" {
|
|
name = "gitea"
|
|
machine_type = "e2-micro"
|
|
zone = "us-west1-a"
|
|
tags = ["gitea"]
|
|
|
|
boot_disk {
|
|
initialize_params {
|
|
image = data.google_compute_image.fedora.self_link
|
|
size = 30
|
|
type = "pd-standard"
|
|
}
|
|
}
|
|
|
|
network_interface {
|
|
network = "default"
|
|
access_config {}
|
|
}
|
|
|
|
metadata = {
|
|
startup-script = file("${path.module}/startup.sh")
|
|
}
|
|
|
|
depends_on = [google_project_service.compute]
|
|
}
|
|
|
|
output "external_ip" {
|
|
value = google_compute_instance.gitea.network_interface[0].access_config[0].nat_ip
|
|
} |