2020-12-03 21:26:28 +00:00
|
|
|
provider "digitalocean" {
|
|
|
|
token = var.do_token
|
|
|
|
spaces_access_id = var.spaces_access_id
|
|
|
|
spaces_secret_key = var.spaces_secret_key
|
|
|
|
}
|
|
|
|
|
2021-01-22 23:22:13 +00:00
|
|
|
module "packer_droplet" {
|
|
|
|
source = "../../../terraform-modules/packer_droplet"
|
|
|
|
name = "gitea"
|
|
|
|
do_token = var.do_token
|
|
|
|
spaces_access_id = var.spaces_access_id
|
|
|
|
spaces_secret_key = var.spaces_secret_key
|
|
|
|
}
|
2021-01-25 22:56:15 +00:00
|
|
|
|
|
|
|
resource "digitalocean_volume" "gitea_volume" {
|
|
|
|
name = "gitea-volume"
|
|
|
|
description = "The volume to hold Gitea repositories and data"
|
|
|
|
region = "nyc1"
|
|
|
|
size = 20
|
|
|
|
initial_filesystem_label = "gitea-volume"
|
|
|
|
initial_filesystem_type = "ext4"
|
|
|
|
tags = ["terraform"]
|
|
|
|
|
|
|
|
lifecycle {
|
|
|
|
prevent_destroy = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "digitalocean_volume_attachment" "gitea" {
|
|
|
|
droplet_id = module.packer_droplet.droplet_id
|
|
|
|
volume_id = digitalocean_volume.gitea_volume.id
|
|
|
|
}
|