Last active
September 6, 2023 12:07
-
-
Save pmanlukas/59d51915a4ee1dcdf53c21a9194f2833 to your computer and use it in GitHub Desktop.
Terraform minio gcp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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