setup website as own file
This commit is contained in:
parent
19887efd22
commit
ad8535ae2d
|
@ -9,17 +9,3 @@ variable "out_dir" {
|
|||
resource "random_id" "suffix" {
|
||||
byte_length = 8
|
||||
}
|
||||
|
||||
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}")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
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}")
|
||||
}
|
Loading…
Reference in New Issue