1
0
Fork 0
distrust-stack/website.tf

51 lines
1.4 KiB
HCL

# Upload files to Digital Ocean
## The Digital Ocean Spaces API is compatible with Amazon S3
# resource "local_exec" "s3cmd" {
# command = "s3cmd put --recursive --acl-public --guess-mime-type --verbose static/ s3://static-site/"
# depends_on = [local_file.index_html, local_file.static_dir]
# }
# Create local directories as scratch space
resource "local_file" "openpgpkey" {
filename = ".well-known/openpgpkey/policy"
content = ""
}
resource "local_file" "hu" {
filename = ".well-known/openpgpkey/hu/.keep"
content = ""
depends_on = [local_file.openpgpkey]
}
resource "local_file" "static_dir" {
filename = "static/.keep"
content = ""
}
# Create local files as scratch space
resource "local_file" "example" {
filename = ".well-known/openpgpkey/policy"
content = ""
depends_on = [local_file.openpgpkey]
}
# # Execute commands required to fetch PGP keys
# resource "local_exec" "command1" {
# command = "command1 arg1 arg2"
# output = var.output1
# depends_on = [local_file.openpgpkey]
# }
# # Execute commands to build static site
# resource "local_exec" "command2" {
# command = "command2 ${var.output1} arg2"
# depends_on = [local_exec.command1]
# }
# Create the Space on Digital Ocean
resource "digitalocean_spaces_bucket" "distrust_co" {
name = "distrust.co"
region = "nyc3"
}
resource "digitalocean_cdn" "distrust_co" {
origin = digitalocean_spaces_bucket.distrust_co.bucket_domain_name
}