Skip to content

Instantly share code, notes, and snippets.

@pmanlukas
Last active September 6, 2023 12:07
Show Gist options
  • Save pmanlukas/59d51915a4ee1dcdf53c21a9194f2833 to your computer and use it in GitHub Desktop.
Save pmanlukas/59d51915a4ee1dcdf53c21a9194f2833 to your computer and use it in GitHub Desktop.
Terraform minio gcp
terraform {
required_providers {
google = "~> 4.0"
}
}
provider "google" {
project = "<YOUR_PROJECT_ID>"
region = "<YOUR_REGION>"
zone = "us-central1-a"
}
resource "google_compute_instance" "minio" {
name = "minio"
machine_type = "n1-standard-1"
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
size = 100
}
}
network_interface {
network = "default"
access_config {
// Ephemeral IP
}
}
tags = ["minio", "http-server", "https-server"]
metadata_startup_script = <<-EOF
apt-get update
apt-get install -y minio
systemctl start minio
systemctl enable minio
EOF
}
resource "google_compute_firewall" "minio-2" {
name = "minio-2"
network = "default"
allow {
protocol = "tcp"
ports = ["80", "443", "9000", "9090"]
}
target_tags = ["minio"]
source_tags = ["minio"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment