~muirrum/devosmium.xyz

ref: cc1ef0ae199b1e63779f2c3c91bd231da3ee32a5 devosmium.xyz/infrastructure/main.tf -rw-r--r-- 1.0 KiB
cc1ef0aeOwen Salter March status update 1 year, 1 month ago
                                                                                
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
variable "token" {
  description = "Linode API access token"
}

variable "root-password" {
  description = "Root password for a linode instance"
}

provider "linode" {
  token = var.token
}

resource "linode_sshkey" "c3po" {
  label   = "c3po"
  ssh_key = chomp(file("~/.ssh/id_rsa.pub"))
}

resource "linode_sshkey" "builds-sr-ht" {
  label   = "builds-sr-ht"
  ssh_key = chomp(file("~/.ssh/builds-sr-ht.pub"))
}

resource "linode_instance" "personal-server" {
  label           = "personal-server"
  image           = "linode/ubuntu18.04"
  region          = "us-central"
  type            = "g6-standard-1"
  authorized_keys = ["${linode_sshkey.c3po.ssh_key}", "${linode_sshkey.builds-sr-ht.ssh_key}"]
  root_pass       = var.root-password
  group           = "personal"
  tags            = ["personal"]
  swap_size       = 256
  private_ip      = false

  alerts {
    cpu            = 75
    network_in     = 50
    network_out    = 50
    io             = 1000
    transfer_quota = 80
  }

  backups_enabled  = false
  watchdog_enabled = false
}