stack/infra/main/website.tf

14 lines
441 B
Terraform
Raw Normal View History

2023-03-31 08:38:53 +00:00
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}")
}