-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
35 lines (29 loc) · 964 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
resource "random_string" "name" {
length = 8
special = false
upper = false
}
resource "bunnynet_storage_zone" "template" {
name = "terraform-template-${random_string.name.result}"
zone_tier = "Edge"
region = "DE"
replication_regions = ["NY", "SYD"]
}
resource "bunnynet_storage_file" "homepage" {
zone = bunnynet_storage_zone.template.id
path = "index.html"
content = "<h1>Hello world</h1><p>Greetings from Terraform via <a href=\"https://${bunnynet_pullzone.template.name}.${bunnynet_pullzone.template.cdn_domain}\">${bunnynet_pullzone.template.name}.${bunnynet_pullzone.template.cdn_domain}</a></p>"
}
resource "bunnynet_pullzone" "template" {
name = bunnynet_storage_zone.template.name
origin {
type = "StorageZone"
storagezone = bunnynet_storage_zone.template.id
}
routing {
tier = "Standard"
}
}
output "url" {
value = "https://${bunnynet_pullzone.template.name}.${bunnynet_pullzone.template.cdn_domain}"
}