-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
57 lines (49 loc) · 908 Bytes
/
main.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
55
56
57
terraform {
required_providers {
fly = {
source = "fly-apps/fly"
version = "~> 0.0.21"
}
}
}
resource "random_pet" "this" {
prefix = "vaultwarden"
}
resource "fly_app" "this" {
name = random_pet.this.id
}
resource "fly_volume" "data" {
app = fly_app.this.id
region = var.region
name = "data"
size = var.size_gb
}
resource "fly_machine" "server" {
app = fly_app.this.id
region = var.region
image = "vaultwarden/server:${var.vaultwarden_version}-alpine"
env = var.env
mounts = [
{
path = "/data"
volume = fly_volume.data.id
encrypted = true
},
]
services = [
{
ports = [
{
port = 443
handlers = ["tls", "http"]
},
]
protocol = "tcp"
internal_port = 80
},
]
}
resource "fly_ip" "this" {
app = fly_app.this.id
type = "v6"
}