Skip to content

Commit a542a34

Browse files
authored
fix(cloudflare): erroneous replacement of r2 custom domain (#1337)
1 parent 17dc28b commit a542a34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

alchemy/src/cloudflare/bucket-custom-domain.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ export type R2BucketCustomDomain = {
100100
minTLS?: "1.0" | "1.1" | "1.2" | "1.3" | (string & {});
101101
};
102102

103+
const DEV_NOOP_ZONE = "noop-zone";
104+
103105
export const R2BucketCustomDomain = Resource(
104106
"cloudflare::R2BucketCustomDomain",
105107
async function (
@@ -114,7 +116,7 @@ export const R2BucketCustomDomain = Resource(
114116
zoneId:
115117
typeof props.zone === "string"
116118
? props.zone
117-
: (props.zone?.id ?? "noop-zone"),
119+
: (props.zone?.id ?? DEV_NOOP_ZONE),
118120
ciphers: props.ciphers,
119121
minTLS: props.minTLS,
120122
};
@@ -158,6 +160,7 @@ export const R2BucketCustomDomain = Resource(
158160
}
159161
case "update": {
160162
if (
163+
this.output.zoneId !== DEV_NOOP_ZONE && // dev mode placeholder should not trigger replacement
161164
diff(this.output, payload).some(
162165
(property) => property === "domain" || property === "zoneId",
163166
)

0 commit comments

Comments
 (0)