Skip to content

Commit cdec1ca

Browse files
committed
🗄 [chore] staging R2 config
1 parent cc18cae commit cdec1ca

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

staging/config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ zones:
33
main: tomy.tech
44

55
# R2 buckets
6-
# location is an optional hint: WNAM, ENAM, WEUR, EEUR, APAC, OC
76
buckets:
87
img:
98
name: tomy-img-staging
109
location: APAC
10+
access_hosts:
11+
# Must include scheme
12+
- https://tomy.tech
13+
- http://localhost:1313
14+
bucket_hosts:
15+
# Must not include scheme
16+
# Must be a subdomain of the main zone
17+
- img.tomy.tech
1118
misc:
1219
name: tomy-misc-staging
1320
location: APAC

staging/main.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ module "zone_main" {
2020
module "r2_img" {
2121
source = "../template/r2"
2222

23-
account_id = var.cloudflare_account_id
24-
bucket_name = local.buckets.img.name
25-
location = local.buckets.img.location
23+
account_id = var.cloudflare_account_id
24+
bucket_name = local.buckets.img.name
25+
location = local.buckets.img.location
26+
access_hosts = local.buckets.img.access_hosts
27+
bucket_hosts = [for host in local.buckets.img.bucket_hosts : {
28+
domain = host
29+
zone_id = module.zone_main.zone_id
30+
}]
2631
}
2732

2833
module "r2_misc" {

0 commit comments

Comments
 (0)