@caelo-cms/provisioning 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/adapter.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface CloudAdapterOutputs {
|
|
|
81
81
|
/** Which environment this output snapshot represents. */
|
|
82
82
|
readonly environment: Environment;
|
|
83
83
|
}
|
|
84
|
-
export type SupportedProvider = "self-hosted" | "gcp" | "aws" | "azure";
|
|
84
|
+
export type SupportedProvider = "self-hosted" | "gcp" | "gcp-firebase" | "aws" | "azure";
|
|
85
85
|
/**
|
|
86
86
|
* Convenience: the shape persisted in `cms_admin.provisioning_outputs.outputs_json`.
|
|
87
87
|
* Pulumi runs the adapter, the CLI's `pulumi-output-sync` subcommand reads
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,WAAW,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClD,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AC;IAClC,2DAA2D;IAC3D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,oGAAoG;IACpG,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACtD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,KAAK,GAAG,cAAc,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caelo-cms/provisioning",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"description": "Pulumi-driven provisioning for Caelo CMS — `bunx @caelo-cms/provisioning --provider <self-hosted|gcp|aws|azure>` brings up a TLS-served install with Postgres + storage + secrets manager + the admin + the API gateway.",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"package.json"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"typecheck": "tsc -b",
|
|
36
|
+
"typecheck": "tsc -b && tsc --project stacks/gcp/tsconfig.json && tsc --project stacks/gcp-firebase/tsconfig.json",
|
|
37
37
|
"build": "tsc -b --force",
|
|
38
|
-
"prepublishOnly": "tsc -b --force"
|
|
38
|
+
"prepublishOnly": "tsc -b --force && tsc --project stacks/gcp/tsconfig.json && tsc --project stacks/gcp-firebase/tsconfig.json"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@caelo-cms/shared": "^0.3.
|
|
41
|
+
"@caelo-cms/shared": "^0.3.5",
|
|
42
42
|
"@clack/prompts": "1.3.0",
|
|
43
43
|
"@pulumi/aws": "^7",
|
|
44
44
|
"@pulumi/awsx": "^3",
|
package/stacks/gcp/index.ts
CHANGED
|
@@ -935,7 +935,7 @@ new gcp.bigquery.DatasetIamMember(
|
|
|
935
935
|
|
|
936
936
|
const tokenInfo = generateBootstrapToken();
|
|
937
937
|
|
|
938
|
-
const dnsRecordsRequired: pulumi.Output<DnsRecord[]> = lbIp.address.apply((ip) => [
|
|
938
|
+
const dnsRecordsRequired: pulumi.Output<DnsRecord[]> = lbIp.address.apply((ip): DnsRecord[] => [
|
|
939
939
|
{
|
|
940
940
|
hostname: domain,
|
|
941
941
|
type: "A",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "nodenext",
|
|
4
|
+
"moduleResolution": "nodenext",
|
|
5
|
+
"target": "es2022",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"noEmit": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["index.ts"],
|
|
13
|
+
"ts-node": {
|
|
14
|
+
"transpileOnly": true,
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"module": "nodenext",
|
|
17
|
+
"moduleResolution": "nodenext"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -309,7 +309,11 @@ const firebaseCustomDomain = new gcp.firebase.HostingCustomDomain(
|
|
|
309
309
|
`${namePrefix}-firebase-apex`,
|
|
310
310
|
{
|
|
311
311
|
project,
|
|
312
|
-
|
|
312
|
+
// Use the input string (known at config time) instead of the
|
|
313
|
+
// resource's siteId output — the typed output is
|
|
314
|
+
// `Output<string | undefined>` but Input<string> doesn't accept
|
|
315
|
+
// undefined.
|
|
316
|
+
siteId: firebaseSiteId,
|
|
313
317
|
customDomain: domain,
|
|
314
318
|
waitDnsVerification: false,
|
|
315
319
|
},
|
|
@@ -419,7 +423,9 @@ const adminSvc = cloudRunService({
|
|
|
419
423
|
iapEnabled: true,
|
|
420
424
|
extraEnv: [
|
|
421
425
|
{ name: "PUBLIC_ADMIN_DATABASE_URL", value: publicAdminDatabaseUrl },
|
|
422
|
-
|
|
426
|
+
// Use the input string (known at config time) — resource output
|
|
427
|
+
// is Output<string | undefined> which Input<string> rejects.
|
|
428
|
+
{ name: "CAELO_FIREBASE_SITE", value: firebaseSiteId },
|
|
423
429
|
{ name: "CAELO_GENERATOR_CLI", value: "/app/apps/static-generator/src/cli.ts" },
|
|
424
430
|
// v0.3.1 — Firebase publisher needs the gateway service name +
|
|
425
431
|
// region to declare the /api/** rewrite when creating each
|
|
@@ -516,7 +522,12 @@ const dnsRecords: pulumi.Output<DnsRecord[]> = pulumi
|
|
|
516
522
|
?.flatMap((s) => s.resourceRecords ?? [])
|
|
517
523
|
.map((r) => ({ type: r.type ?? "CNAME", value: r.rrdata ?? "" })) ?? [];
|
|
518
524
|
for (const t of adminTargets) {
|
|
519
|
-
out.push({
|
|
525
|
+
out.push({
|
|
526
|
+
hostname: adminDomain,
|
|
527
|
+
type: t.type as DnsRecord["type"],
|
|
528
|
+
value: t.value,
|
|
529
|
+
purpose: "Admin app → Cloud Run direct (gen2 IAP-gated)",
|
|
530
|
+
});
|
|
520
531
|
}
|
|
521
532
|
|
|
522
533
|
// Apex — Firebase Hosting custom-domain DNS instructions.
|
|
@@ -529,9 +540,10 @@ const dnsRecords: pulumi.Output<DnsRecord[]> = pulumi
|
|
|
529
540
|
for (const desired of apex.desireds ?? []) {
|
|
530
541
|
for (const v of desired.records ?? []) {
|
|
531
542
|
out.push({
|
|
532
|
-
|
|
543
|
+
hostname: domain,
|
|
533
544
|
type: (v.type ?? "A") as DnsRecord["type"],
|
|
534
545
|
value: v.rdata ?? "",
|
|
546
|
+
purpose: "Public site → Firebase Hosting CDN",
|
|
535
547
|
});
|
|
536
548
|
}
|
|
537
549
|
}
|
|
@@ -539,24 +551,40 @@ const dnsRecords: pulumi.Output<DnsRecord[]> = pulumi
|
|
|
539
551
|
return out;
|
|
540
552
|
});
|
|
541
553
|
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
554
|
+
const tokenInfo = generateBootstrapToken();
|
|
555
|
+
|
|
556
|
+
// Cast pulumi.Output<string> values to plain `string` to satisfy the
|
|
557
|
+
// shared CloudAdapterOutputs shape. Pulumi serialises Outputs to
|
|
558
|
+
// plain strings in stack outputs at runtime; the cast bridges the
|
|
559
|
+
// build-time type. Same pattern as packages/provisioning/stacks/gcp/index.ts.
|
|
560
|
+
const out: CloudAdapterOutputs = {
|
|
561
|
+
adminDatabaseUrl: adminDatabaseUrl as unknown as string,
|
|
562
|
+
publicDatabaseUrl: publicDatabaseUrl as unknown as string,
|
|
563
|
+
mediaStorageUrl: pulumi.interpolate`gs://${mediaBucket.name}` as unknown as string,
|
|
564
|
+
// Firebase Hosting serves media via its own CDN; we proxy through
|
|
565
|
+
// the Firebase site's apex domain for canonical URLs.
|
|
566
|
+
mediaCdnBaseUrl: `https://${domain}/media` as unknown as string,
|
|
567
|
+
bootstrapUrl:
|
|
568
|
+
pulumi.interpolate`https://${adminDomain}/setup?token=${tokenInfo.token}` as unknown as string,
|
|
569
|
+
dnsRecordsRequired: dnsRecords as unknown as DnsRecord[],
|
|
570
|
+
// gcp-firebase doesn't provision BigQuery sinks today (no LB → no
|
|
571
|
+
// edge log stream). v0.3.x+ adds a Firebase Hosting log export.
|
|
572
|
+
edgeLogSinkUrl: `bigquery://${project}/firebase_logs` as unknown as string,
|
|
573
|
+
provider: "gcp-firebase",
|
|
574
|
+
environment: env,
|
|
552
575
|
};
|
|
553
576
|
|
|
554
|
-
export const
|
|
555
|
-
export const
|
|
556
|
-
export const
|
|
557
|
-
export const
|
|
558
|
-
export const
|
|
559
|
-
export const
|
|
560
|
-
export const
|
|
561
|
-
export const
|
|
562
|
-
export const
|
|
577
|
+
export const adminDatabaseUrlOut = out.adminDatabaseUrl;
|
|
578
|
+
export const publicDatabaseUrlOut = out.publicDatabaseUrl;
|
|
579
|
+
export const mediaStorageUrlOut = out.mediaStorageUrl;
|
|
580
|
+
export const mediaCdnBaseUrlOut = out.mediaCdnBaseUrl;
|
|
581
|
+
export const bootstrapUrlOut = out.bootstrapUrl;
|
|
582
|
+
export const dnsRecordsRequiredOut = out.dnsRecordsRequired;
|
|
583
|
+
export const edgeLogSinkUrlOut = out.edgeLogSinkUrl;
|
|
584
|
+
export const providerOut = out.provider;
|
|
585
|
+
export const environmentOut = out.environment;
|
|
586
|
+
export const adminCloudRunUrlOut = adminSvc.uri;
|
|
587
|
+
export const gatewayCloudRunUrlOut = gatewaySvc.uri;
|
|
588
|
+
export const adminDomainOut = adminDomain;
|
|
589
|
+
export const firebaseSiteIdOut = firebaseSiteId;
|
|
590
|
+
export const bootstrapTokenExpiresAtOut = tokenInfo.expiresAt;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "nodenext",
|
|
4
|
+
"moduleResolution": "nodenext",
|
|
5
|
+
"target": "es2022",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"noEmit": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["index.ts"],
|
|
13
|
+
"ts-node": {
|
|
14
|
+
"transpileOnly": true,
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"module": "nodenext",
|
|
17
|
+
"moduleResolution": "nodenext"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|