stack/infra/main/website.tf

14 lines
441 B
HCL

resource "digitalocean_spaces_bucket" "website" {
name = "website-${random_id.suffix.hex}"
region = var.region
}
resource "digitalocean_spaces_bucket_object" "website" {
for_each = fileset("${var.out_dir}/website", "*")
region = var.region
bucket = digitalocean_spaces_bucket.website.name
source = "${var.out_dir}/website/${each.value}"
key = each.value
etag = filemd5("${var.out_dir}/website/${each.value}")
}