-
Notifications
You must be signed in to change notification settings - Fork 0
/
revolt-chat.tf
54 lines (43 loc) · 1.06 KB
/
revolt-chat.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
provider "google" {
project = "your-gcp-project-id"
region = "us-west2"
zone = "us-west2-a"
}
terraform {
backend "gcs" {
bucket = "your-gcs-bucket-name"
prefix = "terraform/state"
}
}
resource "google_compute_address" "static" {
name = "static-ip"
}
resource "google_compute_instance" "default" {
name = "vm-instance"
machine_type = "n1-standard-2" # 2 vCPUs and 7.5GB RAM. Adjust this if needed.
boot_disk {
initialize_params {
image_family = "ubuntu-2004-lts"
image_project = "ubuntu-os-cloud"
size = "20"
}
}
network_interface {
network = "default"
access_config {
nat_ip = google_compute_address.static.address
}
}
metadata_startup_script = file("startup.sh")
tags = ["http-server", "https-server"] # Allow HTTP & HTTPS traffic.
}
resource "google_compute_firewall" "default" {
name = "allow-http-https"
network = "default"
allow {
protocol = "tcp"
ports = ["80", "443"]
}
source_ranges = ["0.0.0.0/0"]
target_tags = ["http-server", "https-server"]
}