@caelo-cms/provisioning 0.10.29 → 0.10.31
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/admin-domain.d.ts +54 -0
- package/dist/admin-domain.d.ts.map +1 -0
- package/dist/admin-domain.js +122 -0
- package/dist/admin-domain.js.map +1 -0
- package/dist/cli.js +71 -7
- package/dist/cli.js.map +1 -1
- package/dist/compose.d.ts +7 -9
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +17 -1
- package/dist/compose.js.map +1 -1
- package/dist/deployed-release.d.ts +84 -0
- package/dist/deployed-release.d.ts.map +1 -0
- package/dist/deployed-release.js +182 -0
- package/dist/deployed-release.js.map +1 -0
- package/dist/gcloud-retry.d.ts +16 -0
- package/dist/gcloud-retry.d.ts.map +1 -0
- package/dist/gcloud-retry.js +17 -0
- package/dist/gcloud-retry.js.map +1 -0
- package/dist/gcloud.d.ts.map +1 -1
- package/dist/gcloud.js +2 -0
- package/dist/gcloud.js.map +1 -1
- package/dist/gcp-names.d.ts +58 -0
- package/dist/gcp-names.d.ts.map +1 -0
- package/dist/gcp-names.js +88 -0
- package/dist/gcp-names.js.map +1 -0
- package/dist/install-state.d.ts +31 -0
- package/dist/install-state.d.ts.map +1 -1
- package/dist/install-state.js +38 -0
- package/dist/install-state.js.map +1 -1
- package/dist/lifecycle.d.ts +5 -0
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +340 -50
- package/dist/lifecycle.js.map +1 -1
- package/dist/mcp-iap.d.ts +5 -26
- package/dist/mcp-iap.d.ts.map +1 -1
- package/dist/mcp-iap.js +6 -18
- package/dist/mcp-iap.js.map +1 -1
- package/dist/migration-runner.d.ts +25 -0
- package/dist/migration-runner.d.ts.map +1 -1
- package/dist/migration-runner.js +60 -19
- package/dist/migration-runner.js.map +1 -1
- package/dist/operator-access.d.ts +83 -0
- package/dist/operator-access.d.ts.map +1 -0
- package/dist/operator-access.js +562 -0
- package/dist/operator-access.js.map +1 -0
- package/dist/region-data.d.ts +30 -0
- package/dist/region-data.d.ts.map +1 -0
- package/dist/region-data.js +406 -0
- package/dist/region-data.js.map +1 -0
- package/dist/regions.d.ts +130 -0
- package/dist/regions.d.ts.map +1 -0
- package/dist/regions.js +247 -0
- package/dist/regions.js.map +1 -0
- package/dist/runtime-secrets.d.ts +128 -0
- package/dist/runtime-secrets.d.ts.map +1 -0
- package/dist/runtime-secrets.js +444 -0
- package/dist/runtime-secrets.js.map +1 -0
- package/dist/stack-contract.d.ts +231 -0
- package/dist/stack-contract.d.ts.map +1 -0
- package/dist/stack-contract.js +455 -0
- package/dist/stack-contract.js.map +1 -0
- package/dist/stack-converge.d.ts +183 -0
- package/dist/stack-converge.d.ts.map +1 -0
- package/dist/stack-converge.js +513 -0
- package/dist/stack-converge.js.map +1 -0
- package/dist/wizard.d.ts +7 -0
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +11 -1
- package/dist/wizard.js.map +1 -1
- package/dist/wizards/gcp-cost.d.ts +10 -10
- package/dist/wizards/gcp-cost.d.ts.map +1 -1
- package/dist/wizards/gcp-cost.js +40 -3
- package/dist/wizards/gcp-cost.js.map +1 -1
- package/dist/wizards/gcp-firebase.d.ts +2 -0
- package/dist/wizards/gcp-firebase.d.ts.map +1 -1
- package/dist/wizards/gcp-firebase.js +1 -0
- package/dist/wizards/gcp-firebase.js.map +1 -1
- package/dist/wizards/gcp-pulumi.d.ts +51 -1
- package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
- package/dist/wizards/gcp-pulumi.js +89 -6
- package/dist/wizards/gcp-pulumi.js.map +1 -1
- package/dist/wizards/gcp.d.ts +2 -0
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +171 -23
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +3 -3
- package/stacks/aws/Pulumi.yaml +5 -2
- package/stacks/aws/README.md +3 -1
- package/stacks/aws/index.ts +21 -1
- package/stacks/azure/Pulumi.yaml +6 -3
- package/stacks/azure/README.md +1 -1
- package/stacks/azure/index.ts +22 -3
- package/stacks/gcp/Pulumi.yaml +5 -5
- package/stacks/gcp/README.md +15 -3
- package/stacks/gcp/index.ts +204 -141
- package/stacks/gcp-firebase/Pulumi.yaml +5 -2
- package/stacks/gcp-firebase/index.ts +169 -76
- package/stacks/self-hosted/Pulumi.yaml +4 -0
- package/stacks/self-hosted/index.ts +3 -0
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-resource static price table for the GCP stack — used by the
|
|
3
|
-
* wizard's pre-flight cost estimate. Prices are EUR/USD per month at
|
|
4
|
-
* `europe-west1` list rates as of 2026-05; ship updates with each
|
|
5
|
-
* Caelo release.
|
|
6
|
-
*
|
|
7
|
-
* The estimate is intentionally OVER-conservative — it shows the
|
|
8
|
-
* floor cost (idle + scale-to-zero traffic). Real usage adds egress
|
|
9
|
-
* + AI calls + storage growth on top.
|
|
10
|
-
*/
|
|
11
1
|
export interface CostLine {
|
|
12
2
|
name: string;
|
|
13
3
|
monthlyUsd: number;
|
|
@@ -17,6 +7,12 @@ export interface CostEstimateInputs {
|
|
|
17
7
|
cloudSqlTier: string;
|
|
18
8
|
cloudSqlHa: boolean;
|
|
19
9
|
adminMinInstances: number;
|
|
10
|
+
/**
|
|
11
|
+
* #553 — admin memory (`2Gi`). Cloud Run bills memory only while an
|
|
12
|
+
* instance runs, so it costs nothing extra at scale-to-zero and
|
|
13
|
+
* ~$6.50/mo per GiB above 1 GiB for each always-on min instance.
|
|
14
|
+
*/
|
|
15
|
+
adminMemory?: string;
|
|
20
16
|
gatewayMinInstances: number;
|
|
21
17
|
wafAdaptiveProtection: boolean;
|
|
22
18
|
/**
|
|
@@ -27,9 +23,13 @@ export interface CostEstimateInputs {
|
|
|
27
23
|
* compatibility.
|
|
28
24
|
*/
|
|
29
25
|
provider?: "gcp" | "gcp-firebase";
|
|
26
|
+
/** #607 — the install region; shown in the table (prices are {@link PRICED_REGION} rates). */
|
|
27
|
+
region: string;
|
|
30
28
|
}
|
|
31
29
|
export declare function estimateGcpCost(inputs: CostEstimateInputs): {
|
|
32
30
|
lines: CostLine[];
|
|
33
31
|
totalUsd: number;
|
|
32
|
+
/** The region line the pre-flight table shows above the costs. */
|
|
33
|
+
regionNote: string;
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=gcp-cost.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-cost.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp-cost.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gcp-cost.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp-cost.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;IAClC,8FAA8F;IAC9F,MAAM,EAAE,MAAM,CAAC;CAChB;AAmBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG;IAC3D,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB,CAiHA"}
|
package/dist/wizards/gcp-cost.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Per-resource static price table for the GCP stack — used by the
|
|
4
|
+
* wizard's pre-flight cost estimate. Prices are EUR/USD per month at
|
|
5
|
+
* `europe-west1` list rates as of 2026-05; ship updates with each
|
|
6
|
+
* Caelo release.
|
|
7
|
+
*
|
|
8
|
+
* The estimate is intentionally OVER-conservative — it shows the
|
|
9
|
+
* floor cost (idle + scale-to-zero traffic). Real usage adds egress
|
|
10
|
+
* + AI calls + storage growth on top.
|
|
11
|
+
*/
|
|
12
|
+
import { ADMIN_MEMORY_DEFAULT, memoryQuantityMiB } from "../stack-contract.js";
|
|
13
|
+
/** The region the price table's list rates are for. */
|
|
14
|
+
const PRICED_REGION = "europe-west1";
|
|
2
15
|
const SQL_TIER_USD = {
|
|
3
16
|
// Shared-core legacy tiers, ENTERPRISE edition
|
|
4
17
|
"db-f1-micro": 9.5,
|
|
@@ -17,6 +30,15 @@ export function estimateGcpCost(inputs) {
|
|
|
17
30
|
const sqlMultiplier = inputs.cloudSqlHa ? 2.0 : 1.0;
|
|
18
31
|
const sqlMonthly = Math.round(sqlBase * sqlMultiplier);
|
|
19
32
|
const provider = inputs.provider ?? "gcp";
|
|
33
|
+
const adminMemory = inputs.adminMemory ?? ADMIN_MEMORY_DEFAULT;
|
|
34
|
+
const adminMiB = memoryQuantityMiB(adminMemory);
|
|
35
|
+
if (adminMiB === null) {
|
|
36
|
+
throw new Error(`adminMemory "${adminMemory}" is not a memory quantity (e.g. 2Gi)`);
|
|
37
|
+
}
|
|
38
|
+
const adminGiB = adminMiB / 1024;
|
|
39
|
+
// An always-on instance is priced at 1 GiB (the $15 line); extra memory
|
|
40
|
+
// is billed per GiB-second (~$6.50 per GiB-month).
|
|
41
|
+
const perMinInstanceUsd = 15 + Math.max(0, adminGiB - 1) * 6.5;
|
|
20
42
|
const lines = [
|
|
21
43
|
{
|
|
22
44
|
name: `Cloud SQL Postgres (${inputs.cloudSqlTier}${inputs.cloudSqlHa ? ", HA" : ""})`,
|
|
@@ -26,12 +48,19 @@ export function estimateGcpCost(inputs) {
|
|
|
26
48
|
: "ZONAL — single zone, automated backups",
|
|
27
49
|
},
|
|
28
50
|
{
|
|
29
|
-
name:
|
|
30
|
-
monthlyUsd: inputs.adminMinInstances === 0
|
|
51
|
+
name: `Cloud Run admin (${adminMemory})`,
|
|
52
|
+
monthlyUsd: inputs.adminMinInstances === 0
|
|
53
|
+
? 1
|
|
54
|
+
: Math.round(1 + inputs.adminMinInstances * perMinInstanceUsd),
|
|
31
55
|
notes: inputs.adminMinInstances === 0
|
|
32
56
|
? "scale-to-zero; ~$1/mo light editorial use"
|
|
33
57
|
: `${inputs.adminMinInstances} min-instance${inputs.adminMinInstances > 1 ? "s" : ""} (no cold start)`,
|
|
34
58
|
},
|
|
59
|
+
{
|
|
60
|
+
name: "Quality checks (Lighthouse on the admin)",
|
|
61
|
+
monthlyUsd: 1,
|
|
62
|
+
notes: "~1-2 min of admin CPU per audited Stage (up to 5 pages x 3 runs); ~$1/mo at a few Stages a day",
|
|
63
|
+
},
|
|
35
64
|
{
|
|
36
65
|
name: "Cloud Run gateway",
|
|
37
66
|
monthlyUsd: inputs.gatewayMinInstances === 0 ? 1 : 1 + inputs.gatewayMinInstances * 15,
|
|
@@ -88,8 +117,16 @@ export function estimateGcpCost(inputs) {
|
|
|
88
117
|
monthlyUsd: 0,
|
|
89
118
|
notes: "Free tier — pay only on >1 TB/mo query",
|
|
90
119
|
},
|
|
120
|
+
{
|
|
121
|
+
name: "Operator-access sync (Cloud Run job + Cloud Scheduler)",
|
|
122
|
+
monthlyUsd: 0,
|
|
123
|
+
notes: "Hourly ~20 s job keeps Google IAP in step with the user list; within the Cloud Run free tier, 1 of 3 free scheduler jobs",
|
|
124
|
+
},
|
|
91
125
|
];
|
|
92
126
|
const totalUsd = lines.reduce((sum, l) => sum + l.monthlyUsd, 0);
|
|
93
|
-
|
|
127
|
+
const regionNote = inputs.region === PRICED_REGION
|
|
128
|
+
? `Region: ${inputs.region} (fixed after install)`
|
|
129
|
+
: `Region: ${inputs.region} (fixed after install) — prices below are ${PRICED_REGION} list rates; ${inputs.region} rates may differ`;
|
|
130
|
+
return { lines, totalUsd, regionNote };
|
|
94
131
|
}
|
|
95
132
|
//# sourceMappingURL=gcp-cost.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-cost.js","sourceRoot":"","sources":["../../src/wizards/gcp-cost.ts"],"names":[],"mappings":"AAAA,mCAAmC;
|
|
1
|
+
{"version":3,"file":"gcp-cost.js","sourceRoot":"","sources":["../../src/wizards/gcp-cost.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;GASG;AAEH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAgC/E,uDAAuD;AACvD,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAM,YAAY,GAA2B;IAC3C,+CAA+C;IAC/C,aAAa,EAAE,GAAG;IAClB,aAAa,EAAE,EAAE;IACjB,qCAAqC;IACrC,uBAAuB,EAAE,EAAE;IAC3B,uBAAuB,EAAE,EAAE;IAC3B,uBAAuB,EAAE,GAAG;IAC5B,kCAAkC;IAClC,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,EAAE;IACtB,mBAAmB,EAAE,GAAG;CACzB,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,MAA0B;IAMxD,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC;IAEvD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;IAC1C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,oBAAoB,CAAC;IAC/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SACnB;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,UAAU,EAAE,CAAC;YACb,KAAK,EAAE,wCAAwC;SAChD;QACD;YACE,IAAI,EAAE,wDAAwD;YAC9D,UAAU,EAAE,CAAC;YACb,KAAK,EACH,0HAA0H;SAC7H;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACjE,MAAM,UAAU,GACd,MAAM,CAAC,MAAM,KAAK,aAAa;QAC7B,CAAC,CAAC,WAAW,MAAM,CAAC,MAAM,wBAAwB;QAClD,CAAC,CAAC,WAAW,MAAM,CAAC,MAAM,6CAA6C,aAAa,gBAAgB,MAAM,CAAC,MAAM,mBAAmB,CAAC;IACzI,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -4,6 +4,8 @@ export interface GcpFirebaseWizardOpts {
|
|
|
4
4
|
ownerEmail: string;
|
|
5
5
|
projectId: string | null;
|
|
6
6
|
nonInteractive: boolean;
|
|
7
|
+
/** #607 — `--region`; see {@link GcpWizardOpts.region}. */
|
|
8
|
+
region?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare function runGcpFirebaseWizard(opts: GcpFirebaseWizardOpts): Promise<void>;
|
|
9
11
|
//# sourceMappingURL=gcp-firebase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-firebase.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp-firebase.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"gcp-firebase.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp-firebase.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-firebase.js","sourceRoot":"","sources":["../../src/wizards/gcp-firebase.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"gcp-firebase.js","sourceRoot":"","sources":["../../src/wizards/gcp-firebase.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAY1C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAA2B;IACpE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAChD,IAAI,CACF;QACE,6BAA6B;QAC7B,KAAK,IAAI,CAAC,kBAAkB,CAAC,6DAA6D;QAC1F,KAAK,IAAI,CAAC,kBAAkB,CAAC,+CAA+C;QAC5E,KAAK,IAAI,CAAC,mBAAmB,CAAC,0CAA0C;QACxE,EAAE;QACF,mEAAmE;QACnE,0FAA0F;KAC3F,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IAEF,kEAAkE;IAClE,+DAA+D;IAC/D,yDAAyD;IACzD,6DAA6D;IAC7D,0DAA0D;IAC1D,mDAAmD;IACnD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,YAAY,CAAC;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,QAAQ,EAAE,cAAc;KACzB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ImageDigests } from "../install-state.js";
|
|
1
2
|
export interface PulumiUpInputs {
|
|
2
3
|
installId: string;
|
|
3
4
|
installRoot: string;
|
|
@@ -11,13 +12,15 @@ export interface PulumiUpInputs {
|
|
|
11
12
|
cloudSqlTier: string;
|
|
12
13
|
cloudSqlHa: boolean;
|
|
13
14
|
adminMinInstances: number;
|
|
15
|
+
/** #553 — admin memory (`2Gi`): it runs the Lighthouse quality audit. */
|
|
16
|
+
adminMemory: string;
|
|
14
17
|
gatewayMinInstances: number;
|
|
15
18
|
wafAdaptiveProtection: boolean;
|
|
16
19
|
iapAllowlist: string[];
|
|
17
20
|
/** Resolved sha256 digests per service (admin, gateway). The wizard
|
|
18
21
|
* pre-resolves the floating `:latest` release tag to a fixed digest
|
|
19
22
|
* so each pulumi up rolls Cloud Run to the newest release image. */
|
|
20
|
-
imageDigests:
|
|
23
|
+
imageDigests: ImageDigests;
|
|
21
24
|
/**
|
|
22
25
|
* v0.3.1 — provider variant. Selects which stack dir to apply
|
|
23
26
|
* + which config namespace (caelo-gcp vs caelo-gcp-firebase).
|
|
@@ -33,6 +36,34 @@ export interface PulumiUpResult {
|
|
|
33
36
|
deleted: number;
|
|
34
37
|
};
|
|
35
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* The stack config keys that pin each Cloud Run service's image
|
|
41
|
+
* (`<ns>:image-digest-<service>`, read by `imageRef` / `imageTag` in the
|
|
42
|
+
* stacks). Shared by the wizard and by `upgrade`'s write-back so both pin
|
|
43
|
+
* the same keys.
|
|
44
|
+
*/
|
|
45
|
+
export declare function imageDigestConfig(provider: "gcp" | "gcp-firebase", digests: ImageDigests): Record<string, {
|
|
46
|
+
value: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Write the digests `upgrade` rolled to into the install's Pulumi stack
|
|
50
|
+
* config, without running `pulumi up`, so a later `pulumi up` keeps them
|
|
51
|
+
* instead of re-resolving the floating tag. On `gcp`, an `image-<service>`
|
|
52
|
+
* override wins over the digest pin (stacks/gcp `imageTag`), so any such
|
|
53
|
+
* override is removed: it no longer describes what the service runs.
|
|
54
|
+
* Needs the `pulumi` CLI (the Automation API shells out to it); throws when
|
|
55
|
+
* the CLI or the stack is missing — the caller reports that.
|
|
56
|
+
*
|
|
57
|
+
* @returns the override keys it removed.
|
|
58
|
+
*/
|
|
59
|
+
export declare function writeImageDigestsToStack(inputs: {
|
|
60
|
+
installRoot: string;
|
|
61
|
+
pulumiPassphrase: string;
|
|
62
|
+
provider: "gcp" | "gcp-firebase";
|
|
63
|
+
digests: ImageDigests;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
removedOverrides: string[];
|
|
66
|
+
}>;
|
|
36
67
|
/**
|
|
37
68
|
* Pick the stack's `secretReplication` (see stacks/<provider>/index.ts).
|
|
38
69
|
* A value already in config wins. Otherwise secrets that already exist
|
|
@@ -43,10 +74,29 @@ export declare function resolveSecretReplication(configured: string | undefined,
|
|
|
43
74
|
type?: string;
|
|
44
75
|
outputs?: Record<string, unknown>;
|
|
45
76
|
}>): "auto" | "regional";
|
|
77
|
+
/** A resource as `pulumi stack export` lists it. */
|
|
78
|
+
interface StateResource {
|
|
79
|
+
type?: string;
|
|
80
|
+
inputs?: Record<string, unknown>;
|
|
81
|
+
outputs?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The region an existing stack was deployed in, read from its state (the
|
|
85
|
+
* stacks' explicit `gcp.Provider` carries it), or null for a stack with
|
|
86
|
+
* nothing deployed. State, not stack config: the config file lives in the
|
|
87
|
+
* package's stack dir, which a newer `bunx` version doesn't share.
|
|
88
|
+
*/
|
|
89
|
+
export declare function deployedStackRegion(resources: ReadonlyArray<StateResource>): string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Refuse to `up` a stack into another region than it was deployed in
|
|
92
|
+
* (#607): Pulumi would replace Cloud SQL, the buckets and the services.
|
|
93
|
+
*/
|
|
94
|
+
export declare function assertStackRegion(deployed: string | null, requested: string): void;
|
|
46
95
|
/**
|
|
47
96
|
* Run `pulumi up` against the GCP stack via the Automation SDK.
|
|
48
97
|
* Streams resource-create events to the supplied onEvent callback so
|
|
49
98
|
* the wizard can render a live progress bar.
|
|
50
99
|
*/
|
|
51
100
|
export declare function pulumiUpGcp(inputs: PulumiUpInputs, onEvent: (kind: "resource" | "error" | "log", message: string) => void): Promise<PulumiUpResult>;
|
|
101
|
+
export {};
|
|
52
102
|
//# sourceMappingURL=gcp-pulumi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-pulumi.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp-pulumi.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,U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G,IAAI,CAa1F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAMlF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GACrE,OAAO,CAAC,cAAc,CAAC,CAwHzB"}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { join, resolve as resolvePath } from "node:path";
|
|
12
12
|
import * as pulumi from "@pulumi/pulumi/automation";
|
|
13
|
+
import { GCP_STACK_ENV } from "../gcp-names.js";
|
|
14
|
+
import { ensureGeneratedSecrets, stackSecretReplication } from "../runtime-secrets.js";
|
|
13
15
|
/**
|
|
14
16
|
* Resolve the GCP stack workdir relative to the installed package.
|
|
15
17
|
* Works whether the CLI runs from source (apps/admin/scripts/...)
|
|
@@ -22,6 +24,50 @@ function gcpStackWorkDir(provider = "gcp") {
|
|
|
22
24
|
// levels up + into the provider-specific stack folder.
|
|
23
25
|
return resolvePath(import.meta.dir, `../../stacks/${provider}`);
|
|
24
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The stack config keys that pin each Cloud Run service's image
|
|
29
|
+
* (`<ns>:image-digest-<service>`, read by `imageRef` / `imageTag` in the
|
|
30
|
+
* stacks). Shared by the wizard and by `upgrade`'s write-back so both pin
|
|
31
|
+
* the same keys.
|
|
32
|
+
*/
|
|
33
|
+
export function imageDigestConfig(provider, digests) {
|
|
34
|
+
return Object.fromEntries(Object.entries(digests).map(([service, digest]) => [
|
|
35
|
+
`caelo-${provider}:image-digest-${service}`,
|
|
36
|
+
{ value: digest },
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Write the digests `upgrade` rolled to into the install's Pulumi stack
|
|
41
|
+
* config, without running `pulumi up`, so a later `pulumi up` keeps them
|
|
42
|
+
* instead of re-resolving the floating tag. On `gcp`, an `image-<service>`
|
|
43
|
+
* override wins over the digest pin (stacks/gcp `imageTag`), so any such
|
|
44
|
+
* override is removed: it no longer describes what the service runs.
|
|
45
|
+
* Needs the `pulumi` CLI (the Automation API shells out to it); throws when
|
|
46
|
+
* the CLI or the stack is missing — the caller reports that.
|
|
47
|
+
*
|
|
48
|
+
* @returns the override keys it removed.
|
|
49
|
+
*/
|
|
50
|
+
export async function writeImageDigestsToStack(inputs) {
|
|
51
|
+
const stack = await pulumi.LocalWorkspace.selectStack({ stackName: GCP_STACK_ENV, workDir: gcpStackWorkDir(inputs.provider) }, {
|
|
52
|
+
envVars: {
|
|
53
|
+
PULUMI_CONFIG_PASSPHRASE: inputs.pulumiPassphrase,
|
|
54
|
+
PULUMI_BACKEND_URL: `file://${join(inputs.installRoot, "state")}`,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
await stack.setAllConfig(imageDigestConfig(inputs.provider, inputs.digests));
|
|
58
|
+
const config = await stack.getAllConfig();
|
|
59
|
+
const removedOverrides = imageOverrideKeys(inputs.provider).filter((k) => k in config);
|
|
60
|
+
if (removedOverrides.length > 0)
|
|
61
|
+
await stack.removeAllConfig(removedOverrides);
|
|
62
|
+
return { removedOverrides };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Stack config keys that override the image a service runs, ahead of the
|
|
66
|
+
* digest pin. Only the `gcp` stack reads them.
|
|
67
|
+
*/
|
|
68
|
+
function imageOverrideKeys(provider) {
|
|
69
|
+
return provider === "gcp" ? ["caelo-gcp:image-admin", "caelo-gcp:image-gateway"] : [];
|
|
70
|
+
}
|
|
25
71
|
/**
|
|
26
72
|
* Pick the stack's `secretReplication` (see stacks/<provider>/index.ts).
|
|
27
73
|
* A value already in config wins. Otherwise secrets that already exist
|
|
@@ -42,6 +88,31 @@ export function resolveSecretReplication(configured, stateResources) {
|
|
|
42
88
|
});
|
|
43
89
|
return hasAutoSecret ? "auto" : "regional";
|
|
44
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* The region an existing stack was deployed in, read from its state (the
|
|
93
|
+
* stacks' explicit `gcp.Provider` carries it), or null for a stack with
|
|
94
|
+
* nothing deployed. State, not stack config: the config file lives in the
|
|
95
|
+
* package's stack dir, which a newer `bunx` version doesn't share.
|
|
96
|
+
*/
|
|
97
|
+
export function deployedStackRegion(resources) {
|
|
98
|
+
const regions = new Set(resources
|
|
99
|
+
.filter((r) => r.type === "pulumi:providers:gcp")
|
|
100
|
+
.map((r) => r.inputs?.region)
|
|
101
|
+
.filter((v) => typeof v === "string" && v.length > 0));
|
|
102
|
+
if (regions.size > 1) {
|
|
103
|
+
throw new Error(`the Pulumi state holds GCP providers for several regions (${[...regions].join(", ")}); fix the stack before re-running.`);
|
|
104
|
+
}
|
|
105
|
+
return [...regions][0] ?? null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Refuse to `up` a stack into another region than it was deployed in
|
|
109
|
+
* (#607): Pulumi would replace Cloud SQL, the buckets and the services.
|
|
110
|
+
*/
|
|
111
|
+
export function assertStackRegion(deployed, requested) {
|
|
112
|
+
if (deployed && deployed !== requested) {
|
|
113
|
+
throw new Error(`this install's stack is deployed in ${deployed}, but the run asks for ${requested}. The region is fixed after install — moving it would replace the database, buckets and services. Set "region": "${deployed}" in install.json and re-run.`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
45
116
|
/**
|
|
46
117
|
* Run `pulumi up` against the GCP stack via the Automation SDK.
|
|
47
118
|
* Streams resource-create events to the supplied onEvent callback so
|
|
@@ -59,7 +130,7 @@ export async function pulumiUpGcp(inputs, onEvent) {
|
|
|
59
130
|
PULUMI_BACKEND_URL: `file://${join(inputs.installRoot, "state")}`,
|
|
60
131
|
};
|
|
61
132
|
const provider = inputs.provider ?? "gcp";
|
|
62
|
-
const stackName =
|
|
133
|
+
const stackName = GCP_STACK_ENV;
|
|
63
134
|
const workDir = gcpStackWorkDir(provider);
|
|
64
135
|
// Pulumi config namespace mirrors the stack's `name:` field in
|
|
65
136
|
// Pulumi.yaml (caelo-gcp vs caelo-gcp-firebase).
|
|
@@ -70,6 +141,9 @@ export async function pulumiUpGcp(inputs, onEvent) {
|
|
|
70
141
|
}, {
|
|
71
142
|
envVars: env,
|
|
72
143
|
});
|
|
144
|
+
const stateResources = ((await stack.exportStack()).deployment?.resources ??
|
|
145
|
+
[]);
|
|
146
|
+
assertStackRegion(deployedStackRegion(stateResources), inputs.region);
|
|
73
147
|
// Set every config value the stack reads. Secrets via setConfig with
|
|
74
148
|
// {value, secret: true}; Pulumi encrypts them in state.
|
|
75
149
|
// wafAdaptiveProtection is gcp-only; the gcp-firebase stack has no
|
|
@@ -82,6 +156,7 @@ export async function pulumiUpGcp(inputs, onEvent) {
|
|
|
82
156
|
[`${ns}:cloudSqlTier`]: { value: inputs.cloudSqlTier },
|
|
83
157
|
[`${ns}:cloudSqlHa`]: { value: String(inputs.cloudSqlHa) },
|
|
84
158
|
[`${ns}:adminMinInstances`]: { value: String(inputs.adminMinInstances) },
|
|
159
|
+
[`${ns}:adminMemory`]: { value: inputs.adminMemory },
|
|
85
160
|
[`${ns}:gatewayMinInstances`]: { value: String(inputs.gatewayMinInstances) },
|
|
86
161
|
...(provider === "gcp"
|
|
87
162
|
? { [`${ns}:wafAdaptiveProtection`]: { value: String(inputs.wafAdaptiveProtection) } }
|
|
@@ -91,10 +166,7 @@ export async function pulumiUpGcp(inputs, onEvent) {
|
|
|
91
166
|
// /security/ai → ai_providers (KEK-encrypted). The pre-v0.3.2
|
|
92
167
|
// Secret + SecretVersion in Secret Manager were never mounted
|
|
93
168
|
// on Cloud Run, so the config was dead.
|
|
94
|
-
...
|
|
95
|
-
`${ns}:image-digest-${service}`,
|
|
96
|
-
{ value: digest },
|
|
97
|
-
])),
|
|
169
|
+
...imageDigestConfig(provider, inputs.imageDigests),
|
|
98
170
|
});
|
|
99
171
|
// Read back only after the required keys are set: `pulumi config` refuses to
|
|
100
172
|
// list a stack that lacks them, which is every fresh stack.
|
|
@@ -103,8 +175,19 @@ export async function pulumiUpGcp(inputs, onEvent) {
|
|
|
103
175
|
return undefined;
|
|
104
176
|
throw e;
|
|
105
177
|
});
|
|
106
|
-
const secretReplication = resolveSecretReplication(configuredReplication,
|
|
178
|
+
const secretReplication = resolveSecretReplication(configuredReplication, stateResources);
|
|
107
179
|
await stack.setConfig(`${ns}:secretReplication`, { value: secretReplication });
|
|
180
|
+
// The stack references the CLI-generated runtime secrets (stack-contract.ts
|
|
181
|
+
// CLI_GENERATED_SECRETS) by id, so they must exist before `up`.
|
|
182
|
+
const generated = await ensureGeneratedSecrets({
|
|
183
|
+
projectId: inputs.projectId,
|
|
184
|
+
env: stackName,
|
|
185
|
+
replication: stackSecretReplication(secretReplication, inputs.region),
|
|
186
|
+
});
|
|
187
|
+
const notEnsured = generated.filter((o) => o.status === "failed");
|
|
188
|
+
if (notEnsured.length > 0) {
|
|
189
|
+
throw new Error(`could not create the runtime secrets: ${notEnsured.map((o) => `${o.id}: ${o.error ?? ""}`).join("; ")}`);
|
|
190
|
+
}
|
|
108
191
|
// Refresh state first to detect drift from any out-of-band changes.
|
|
109
192
|
await stack.refresh({ onOutput: (msg) => onEvent("log", msg) });
|
|
110
193
|
// Run `up`. The onEvent callback receives the same JSON-RPC events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-pulumi.js","sourceRoot":"","sources":["../../src/wizards/gcp-pulumi.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"gcp-pulumi.js","sourceRoot":"","sources":["../../src/wizards/gcp-pulumi.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAE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AC,MAAM,EAAE,CAC3E,CAAC;YACJ,CAAC;iBAAM,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;gBACjC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC;IAC9C,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACpD,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;IACvB,CAAC;IAED,OAAO;QACL,OAAO;QACP,aAAa,EAAE;YACb,OAAO,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;YAC5B,OAAO,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;YAC5B,OAAO,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;SAC7B;KACF,CAAC;AACJ,CAAC"}
|
package/dist/wizards/gcp.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export interface GcpWizardOpts {
|
|
|
4
4
|
ownerEmail: string;
|
|
5
5
|
projectId: string | null;
|
|
6
6
|
nonInteractive: boolean;
|
|
7
|
+
/** #607 — `--region`; required for a new install when non-interactive. */
|
|
8
|
+
region?: string;
|
|
7
9
|
/**
|
|
8
10
|
* v0.3.1 — provider variant. 'gcp' is the LB-based topology;
|
|
9
11
|
* 'gcp-firebase' adds Firebase Hosting + Cloud Run direct. The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gcp.d.ts","sourceRoot":"","sources":["../../src/wizards/gcp.ts"],"names":[],"mappings":"AA8EA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;CACnC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuOrE"}
|