@fjall/generator 16.0.1 → 17.0.0

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.
@@ -9,7 +9,7 @@
9
9
  "package.json",
10
10
  "tsconfig.json"
11
11
  ],
12
- "hash": "f6685c608cca04beb979959ce118ac282ad9f421c377fd89eb01269914ce21d1",
12
+ "hash": "2b2e7e2283e0b4a22117d828e40a7d564a6c8eb0e72dd88fa8610f5f79c0f766",
13
13
  "files": {
14
14
  "src/ast/astTestHelpers.ts": "026cac849eb88bdb",
15
15
  "src/ast/domain/astDomainParser.ts": "54a50bcec75a8306",
@@ -23,7 +23,7 @@
23
23
  "src/ast/parsers/orchestrator/astInfrastructureParser.ts": "07fd7a94796ebf5f",
24
24
  "src/ast/parsers/orchestrator/astPlanConverter.ts": "8e8ceedc328f4181",
25
25
  "src/ast/parsers/resources/astCdnParser.ts": "726b298b0b580d68",
26
- "src/ast/parsers/resources/astClickHouseParser.ts": "cf49943b3d2bbd48",
26
+ "src/ast/parsers/resources/astClickHouseParser.ts": "52dda31086619b09",
27
27
  "src/ast/parsers/resources/astComputeConnectionParser.ts": "e0f1533845f3ce8a",
28
28
  "src/ast/parsers/resources/astComputeParser.ts": "8caa5cc22af1913a",
29
29
  "src/ast/parsers/resources/astComputeParserHelpers.ts": "4763a0f0afbd4880",
@@ -126,7 +126,7 @@
126
126
  "src/generation/compute/lambda.ts": "932a45cdc26a5730",
127
127
  "src/generation/compute/shared.ts": "3724d4bfe92cfcb7",
128
128
  "src/generation/connectionWiring.ts": "9afb0227f2584ab2",
129
- "src/generation/database.ts": "ac25ebfd8f24275b",
129
+ "src/generation/database.ts": "c28a0dbabf91b6a3",
130
130
  "src/generation/generatePatternCode.ts": "afed698418d90aee",
131
131
  "src/generation/index.ts": "915500e352c2bab6",
132
132
  "src/generation/infrastructure.ts": "0ac7c1954a02b2cc",
@@ -139,16 +139,16 @@
139
139
  "src/planning/generateResourceChange.ts": "1c6411f9a12e7acb",
140
140
  "src/planning/index.ts": "8ef807b31c43310c",
141
141
  "src/planning/openNextPlanning.ts": "4af9cb9061f7d21e",
142
- "src/planning/planBuilders.ts": "bea93d0c05caef21",
142
+ "src/planning/planBuilders.ts": "2c5a92dbaab57e1d",
143
143
  "src/planning/resourceAddition.ts": "7d0320620a74fdcd",
144
144
  "src/planning/resourceConnections.ts": "a6b7db8f733e560f",
145
145
  "src/planning/resourcePlanning.ts": "d6bb9fa8e1419908",
146
146
  "src/planning/staticSitePlanning.ts": "242af1e9618821ab",
147
- "src/presets/clickhouseTierPreset.ts": "72b2b8a8caf4bdb4",
147
+ "src/presets/clickhouseTierPreset.ts": "1758d991c81d769a",
148
148
  "src/presets/index.ts": "8332c0198b2a6fe9",
149
149
  "src/presets/patternTierPresets.ts": "f4fc368fc623aae4",
150
150
  "src/presets/storagePresets.ts": "5df2d4d7d21a66d8",
151
- "src/presets/tierPresets.ts": "c0148771bffbef9b",
151
+ "src/presets/tierPresets.ts": "d1a43f07288b4012",
152
152
  "src/presets/tierTypes.ts": "6526373876daacf0",
153
153
  "src/projection/compute.ts": "66ea8ee6011ad615",
154
154
  "src/projection/index.ts": "3ddb1d53f5781805",
@@ -164,7 +164,7 @@
164
164
  "src/schemas/cdnSchemas.ts": "16784f15894c62ba",
165
165
  "src/schemas/computeSchemas.ts": "7105193fd34c8bcb",
166
166
  "src/schemas/constants.ts": "b0abe53d7a42feb0",
167
- "src/schemas/databaseSchemas.ts": "3c05f176e1aadb46",
167
+ "src/schemas/databaseSchemas.ts": "7d33a96789cbfdb5",
168
168
  "src/schemas/devRolePolicies.ts": "6ca70fb20f5fbebc",
169
169
  "src/schemas/index.ts": "a1500a885048074b",
170
170
  "src/schemas/instanceTypeArchitecture.ts": "6bf38031a54a4620",
@@ -179,13 +179,13 @@
179
179
  "src/types/Result.ts": "6a078a91fc3072e3",
180
180
  "src/util/errorUtils.ts": "c021c57804424a5d",
181
181
  "src/validation/patterns.ts": "f9629eafdad7ac3e",
182
- "src/validation/validationMessages.ts": "772ae6e5a897a301",
182
+ "src/validation/validationMessages.ts": "d08297f78d39f57c",
183
183
  "src/validation/validationPatterns.ts": "865f3d688975b7c8",
184
- "src/version.ts": "919ec14858eb12a9",
184
+ "src/version.ts": "b253dedc63643114",
185
185
  "../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
186
- "package.json": "0a080fff7d342c98",
186
+ "package.json": "220c474ad9d94fa5",
187
187
  "tsconfig.json": "1929cf3f99fe9b1e"
188
188
  },
189
- "outputHash": "dd1cb1a73d2014acf9225083326ab2a5713313fb3d7fe4cad0f0e519286e056d",
189
+ "outputHash": "60d753f456f3e16260275f3e1cf6ed96531a3953826c08d92816d8c1be96e735",
190
190
  "outputFileCount": 343
191
191
  }
package/dist/.minified CHANGED
@@ -1 +1 @@
1
- 171 files minified at 2026-08-22T04:03:49.206Z
1
+ 171 files minified at 2026-08-23T02:03:13.908Z
@@ -677,11 +677,15 @@ export declare function parseAndConvert(code: string): {
677
677
  type: "ClickHouse";
678
678
  databaseName: string;
679
679
  instanceType?: string | undefined;
680
+ storageGb?: number | undefined;
681
+ iops?: number | undefined;
682
+ throughputMbps?: number | undefined;
680
683
  coldTier?: false | {
681
684
  mode: "s3";
682
685
  } | undefined;
683
686
  optimiseSchedule?: string | false | undefined;
684
687
  backupSchedule?: string | false | undefined;
688
+ backupVerify?: false | undefined;
685
689
  backupRetentionDays?: number | undefined;
686
690
  variableName?: string | undefined;
687
691
  extraProperties?: {
@@ -12,11 +12,15 @@ export interface ParsedClickHouseResource {
12
12
  resourceName: string;
13
13
  databaseName: string;
14
14
  instanceType?: string;
15
+ storageGb?: number;
16
+ iops?: number;
17
+ throughputMbps?: number;
15
18
  coldTier?: {
16
19
  mode: "s3";
17
20
  } | false;
18
21
  optimiseSchedule?: string | false;
19
22
  backupSchedule?: string | false;
23
+ backupVerify?: false;
20
24
  backupRetentionDays?: number;
21
25
  extraProperties?: ExtraProperty[];
22
26
  node: ts.Node;
@@ -1 +1 @@
1
- var S=Object.defineProperty;var r=(a,e)=>S(a,"name",{value:e,configurable:!0});import*as c from"typescript";import{asNumber as N,asString as s,captureExtraProperties as k,isParsedObject as y,omitUndefined as g,parseObjectLiteral as T}from"../common/astCommonParser.js";const x=new Set(["type","databaseName","instanceType","coldTier","optimiseSchedule","backupSchedule","backupRetentionDays"]);function v(a){const e=a.node;if(!c.isCallExpression(e))return null;const o=e.arguments[0];if(!c.isCallExpression(o)||o.arguments.length<2)return null;const u=o.arguments[1];if(!c.isObjectLiteralExpression(u))return null;const i=T(u),t={resourceName:a.resourceName,databaseName:a.databaseName,node:a.node};a.variableName&&(t.variableName=a.variableName);const d=s(i.instanceType);d&&(t.instanceType=d);const l=i.coldTier;l===!1?t.coldTier=!1:y(l)&&s(l.mode)==="s3"&&(t.coldTier={mode:"s3"});const p=i.optimiseSchedule;if(p===!1)t.optimiseSchedule=!1;else{const n=s(p);n&&(t.optimiseSchedule=n)}const m=i.backupSchedule;if(m===!1)t.backupSchedule=!1;else{const n=s(m);n&&(t.backupSchedule=n)}const f=N(i.backupRetentionDays);f!==void 0&&(t.backupRetentionDays=f);const b=k(i,x);return b.length>0&&(t.extraProperties=b),t}r(v,"extractClickHouseFields");function D(a){if(a.length!==0)return a.map(e=>({name:e.resourceName,type:"ClickHouse",databaseName:e.databaseName,...g({instanceType:e.instanceType,coldTier:e.coldTier,optimiseSchedule:e.optimiseSchedule,backupSchedule:e.backupSchedule,backupRetentionDays:e.backupRetentionDays,variableName:e.variableName,extraProperties:e.extraProperties})}))}r(D,"convertClickHouseResources");export{D as convertClickHouseResources,v as extractClickHouseFields};
1
+ var h=Object.defineProperty;var p=(a,e)=>h(a,"name",{value:e,configurable:!0});import*as c from"typescript";import{asNumber as n,asString as o,captureExtraProperties as N,isParsedObject as T,omitUndefined as x,parseObjectLiteral as C}from"../common/astCommonParser.js";const v=new Set(["type","databaseName","instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays"]);function G(a){const e=a.node;if(!c.isCallExpression(e))return null;const r=e.arguments[0];if(!c.isCallExpression(r)||r.arguments.length<2)return null;const l=r.arguments[1];if(!c.isObjectLiteralExpression(l))return null;const i=C(l),t={resourceName:a.resourceName,databaseName:a.databaseName,node:a.node};a.variableName&&(t.variableName=a.variableName);const d=o(i.instanceType);d&&(t.instanceType=d);const b=n(i.storageGb);b!==void 0&&(t.storageGb=b);const f=n(i.iops);f!==void 0&&(t.iops=f);const m=n(i.throughputMbps);m!==void 0&&(t.throughputMbps=m);const u=i.coldTier;u===!1?t.coldTier=!1:T(u)&&o(u.mode)==="s3"&&(t.coldTier={mode:"s3"});const g=i.optimiseSchedule;if(g===!1)t.optimiseSchedule=!1;else{const s=o(g);s&&(t.optimiseSchedule=s)}const k=i.backupSchedule;if(k===!1)t.backupSchedule=!1;else{const s=o(k);s&&(t.backupSchedule=s)}i.backupVerify===!1&&(t.backupVerify=!1);const S=n(i.backupRetentionDays);S!==void 0&&(t.backupRetentionDays=S);const y=N(i,v);return y.length>0&&(t.extraProperties=y),t}p(G,"extractClickHouseFields");function M(a){if(a.length!==0)return a.map(e=>({name:e.resourceName,type:"ClickHouse",databaseName:e.databaseName,...x({instanceType:e.instanceType,storageGb:e.storageGb,iops:e.iops,throughputMbps:e.throughputMbps,coldTier:e.coldTier,optimiseSchedule:e.optimiseSchedule,backupSchedule:e.backupSchedule,backupVerify:e.backupVerify,backupRetentionDays:e.backupRetentionDays,variableName:e.variableName,extraProperties:e.extraProperties})}))}p(M,"convertClickHouseResources");export{M as convertClickHouseResources,G as extractClickHouseFields};
@@ -1,26 +1,30 @@
1
- var m=Object.defineProperty;var t=(e,n)=>m(e,"name",{value:n,configurable:!0});import{buildProperty as o,connectionEnvSuffix as b,formatValue as a,getVariableName as p,emitExtraProperties as g,escapeStringLiteral as s,formatStringArray as h,emitProductionAlertsTopicSpread as A}from"./common.js";import{DATABASE_INVOCATION as f}from"./statementInvocation.js";import{DATABASE_SSL_VALUE as y,buildConnectionWiringEntries as x,renderWiringValueSource as S}from"./connectionWiring.js";import{CREDENTIAL_KEYS as U,DATABASE_ACCESSORS as z,DATABASE_ENV_VARS as F,DATABASE_SSL_VALUE as O}from"./connectionWiring.js";function $(e,n){const i=n.connectedDatabase;return i?.length?e.database.filter(r=>i.includes(r.name)):[]}t($,"getConnectedDatabases");function k(e){const n=[];for(const[i,r]of e.entries()){const l=p(r),d=b(i);for(const c of x("database",d))n.push({key:c.key,expression:S(c.value,l),isSecret:c.target==="secretsImport"})}return n}t(k,"generateDatabaseEnvVarEntries");function P(e){return`connections: [${e.map(i=>p(i)).join(", ")}],`}t(P,"formatConnectionsCode");function E(e){return e.expression===s(y)?y:{__expression:e.expression}}t(E,"toDatabaseEnvVarValue");function W(e,n){const i={},r={};if(!n.needsConnection||!n.connectedDatabase?.length)return{env:i,secrets:r};const l=$(e,n),d=k(l);for(const c of d){const u=E(c);c.isSecret?r[c.key]={__expression:c.expression}:i[c.key]=u}return{env:i,secrets:r}}t(W,"buildDatabaseEnvVars");function D(e){let n="";return n+=o(e.port!==void 0,"port",e.port),n+=o(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),n+=o(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),n+=o(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),n+=o(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),n}t(D,"generateDatabaseSharedProps");function I(e){if(e.type!=="Instance")return"";let n="";return n+=o(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),n+=o(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),n+=o(e.multiAz!==void 0,"multiAz",e.multiAz),n+=o(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),n+=o(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=o(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=o(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=o(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),n+=o(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=o(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n}t(I,"generateDatabaseInstanceProps");function R(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let n="";return n+=o(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=o(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=o(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=o(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=o(e.writer!==void 0,"writer",e.writer,"object"),n+=o(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),n+=o(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n+=o(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),n}t(R,"generateDatabaseAuroraProps");function C(e){if(e.type!=="GlobalAurora")return"";let n="";return n+=o(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(n+=`
2
- secondaryRegions: [${h(e.secondaryRegions)}],`),n+=o(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),n+=o(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),n}t(C,"generateDatabaseGlobalAuroraProps");function V(e,n){return n.compute.some(i=>i.needsConnection&&i.connectedDatabase?.includes(e.name))}t(V,"databaseNeedsVariable");function G(e){if(e.database.length===0)return"";let n="";for(let i=0;i<e.database.length;i++){const r=e.database[i],l=p(r),d=V(r,e),c=i>0,u=d?`const ${l} = `:"";n+=`${c?`
3
- `:""}${u}app.${f.appMethod}(
4
- ${f.factory}.build(${s(r.name)}, {
1
+ var y=Object.defineProperty;var t=(e,n)=>y(e,"name",{value:n,configurable:!0});import{buildProperty as r,connectionEnvSuffix as m,formatValue as a,getVariableName as p,emitExtraProperties as g,escapeStringLiteral as s,formatStringArray as h,emitProductionAlertsTopicSpread as A}from"./common.js";import{DATABASE_INVOCATION as f}from"./statementInvocation.js";import{DATABASE_SSL_VALUE as b,buildConnectionWiringEntries as x,renderWiringValueSource as S}from"./connectionWiring.js";import{CREDENTIAL_KEYS as U,DATABASE_ACCESSORS as z,DATABASE_ENV_VARS as F,DATABASE_SSL_VALUE as O}from"./connectionWiring.js";function $(e,n){const o=n.connectedDatabase;return o?.length?e.database.filter(i=>o.includes(i.name)):[]}t($,"getConnectedDatabases");function k(e){const n=[];for(const[o,i]of e.entries()){const u=p(i),d=m(o);for(const c of x("database",d))n.push({key:c.key,expression:S(c.value,u),isSecret:c.target==="secretsImport"})}return n}t(k,"generateDatabaseEnvVarEntries");function P(e){return`connections: [${e.map(o=>p(o)).join(", ")}],`}t(P,"formatConnectionsCode");function E(e){return e.expression===s(b)?b:{__expression:e.expression}}t(E,"toDatabaseEnvVarValue");function G(e,n){const o={},i={};if(!n.needsConnection||!n.connectedDatabase?.length)return{env:o,secrets:i};const u=$(e,n),d=k(u);for(const c of d){const l=E(c);c.isSecret?i[c.key]={__expression:c.expression}:o[c.key]=l}return{env:o,secrets:i}}t(G,"buildDatabaseEnvVars");function D(e){let n="";return n+=r(e.port!==void 0,"port",e.port),n+=r(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),n+=r(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),n+=r(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),n+=r(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),n}t(D,"generateDatabaseSharedProps");function I(e){if(e.type!=="Instance")return"";let n="";return n+=r(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),n+=r(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),n+=r(e.multiAz!==void 0,"multiAz",e.multiAz),n+=r(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),n+=r(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=r(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=r(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=r(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),n+=r(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=r(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n}t(I,"generateDatabaseInstanceProps");function R(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let n="";return n+=r(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=r(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=r(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=r(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=r(e.writer!==void 0,"writer",e.writer,"object"),n+=r(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),n+=r(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n+=r(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),n}t(R,"generateDatabaseAuroraProps");function V(e){if(e.type!=="GlobalAurora")return"";let n="";return n+=r(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(n+=`
2
+ secondaryRegions: [${h(e.secondaryRegions)}],`),n+=r(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),n+=r(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),n}t(V,"generateDatabaseGlobalAuroraProps");function C(e,n){return n.compute.some(o=>o.needsConnection&&o.connectedDatabase?.includes(e.name))}t(C,"databaseNeedsVariable");function M(e){if(e.database.length===0)return"";let n="";for(let o=0;o<e.database.length;o++){const i=e.database[o],u=p(i),d=C(i,e),c=o>0,l=d?`const ${u} = `:"";n+=`${c?`
3
+ `:""}${l}app.${f.appMethod}(
4
+ ${f.factory}.build(${s(i.name)}, {
5
5
  vpc: app.getVpc(),
6
- type: ${s(r.type)},
7
- databaseName: ${s(r.databaseName)},`,r.engineExpression?n+=`
8
- engine: ${r.engineExpression},`:r.databaseEngine&&(n+=`
9
- databaseEngine: ${s(r.databaseEngine)},`),n+=D(r),n+=I(r),n+=R(r),n+=C(r),n+=g(r.extraProperties),r.alarms===!1?n+=`
10
- alarms: false,`:typeof r.alarms=="object"&&(n+=`
11
- alarms: ${a(r.alarms," ")},`),r.type!=="GlobalAurora"&&(n+=A()),n+=`
6
+ type: ${s(i.type)},
7
+ databaseName: ${s(i.databaseName)},`,i.engineExpression?n+=`
8
+ engine: ${i.engineExpression},`:i.databaseEngine&&(n+=`
9
+ databaseEngine: ${s(i.databaseEngine)},`),n+=D(i),n+=I(i),n+=R(i),n+=V(i),n+=g(i.extraProperties),i.alarms===!1?n+=`
10
+ alarms: false,`:typeof i.alarms=="object"&&(n+=`
11
+ alarms: ${a(i.alarms," ")},`),i.type!=="GlobalAurora"&&(n+=A()),n+=`
12
12
  })
13
13
  );
14
- `}return n}t(G,"generateDatabaseCode");function L(e){if(!e.clickhouse||e.clickhouse.length===0)return"";let n="";for(let i=0;i<e.clickhouse.length;i++){const r=e.clickhouse[i],l=p(r),d=T(r,e),c=i>0?`
15
- `:"",u=d?`const ${l} = `:"";n+=`${c}${u}app.${f.appMethod}(
16
- ${f.factory}.build(${s(r.name)}, {
14
+ `}return n}t(M,"generateDatabaseCode");function W(e){if(!e.clickhouse||e.clickhouse.length===0)return"";let n="";for(let o=0;o<e.clickhouse.length;o++){const i=e.clickhouse[o],u=p(i),d=T(i,e),c=o>0?`
15
+ `:"",l=d?`const ${u} = `:"";n+=`${c}${l}app.${f.appMethod}(
16
+ ${f.factory}.build(${s(i.name)}, {
17
17
  type: "ClickHouse",
18
- databaseName: ${s(r.databaseName)},`,r.instanceType!==void 0&&(n+=`
19
- instanceType: ${s(r.instanceType)},`),r.coldTier!==void 0&&(n+=`
20
- coldTier: ${a(r.coldTier," ")},`),r.optimiseSchedule!==void 0&&(n+=`
21
- optimiseSchedule: ${a(r.optimiseSchedule," ")},`),r.backupSchedule!==void 0&&(n+=`
22
- backupSchedule: ${a(r.backupSchedule," ")},`),r.backupRetentionDays!==void 0&&(n+=`
23
- backupRetentionDays: ${r.backupRetentionDays},`),n+=g(r.extraProperties),n+=`
18
+ databaseName: ${s(i.databaseName)},`,i.instanceType!==void 0&&(n+=`
19
+ instanceType: ${s(i.instanceType)},`),i.storageGb!==void 0&&(n+=`
20
+ storageGb: ${i.storageGb},`),i.iops!==void 0&&(n+=`
21
+ iops: ${i.iops},`),i.throughputMbps!==void 0&&(n+=`
22
+ throughputMbps: ${i.throughputMbps},`),i.coldTier!==void 0&&(n+=`
23
+ coldTier: ${a(i.coldTier," ")},`),i.optimiseSchedule!==void 0&&(n+=`
24
+ optimiseSchedule: ${a(i.optimiseSchedule," ")},`),i.backupSchedule!==void 0&&(n+=`
25
+ backupSchedule: ${a(i.backupSchedule," ")},`),i.backupVerify!==void 0&&(n+=`
26
+ backupVerify: ${a(i.backupVerify," ")},`),i.backupRetentionDays!==void 0&&(n+=`
27
+ backupRetentionDays: ${i.backupRetentionDays},`),n+=g(i.extraProperties),n+=`
24
28
  })
25
29
  );
26
- `}return n}t(L,"generateClickHouseCode");function T(e,n){return n.compute.some(i=>i.connectedDatabase?.includes(e.name))}t(T,"clickhouseNeedsVariable");export{U as CREDENTIAL_KEYS,z as DATABASE_ACCESSORS,F as DATABASE_ENV_VARS,O as DATABASE_SSL_VALUE,W as buildDatabaseEnvVars,T as clickhouseNeedsVariable,V as databaseNeedsVariable,P as formatConnectionsCode,L as generateClickHouseCode,G as generateDatabaseCode,k as generateDatabaseEnvVarEntries,$ as getConnectedDatabases,E as toDatabaseEnvVarValue};
30
+ `}return n}t(W,"generateClickHouseCode");function T(e,n){return n.compute.some(o=>o.connectedDatabase?.includes(e.name))}t(T,"clickhouseNeedsVariable");export{U as CREDENTIAL_KEYS,z as DATABASE_ACCESSORS,F as DATABASE_ENV_VARS,O as DATABASE_SSL_VALUE,G as buildDatabaseEnvVars,T as clickhouseNeedsVariable,C as databaseNeedsVariable,P as formatConnectionsCode,W as generateClickHouseCode,M as generateDatabaseCode,k as generateDatabaseEnvVarEntries,$ as getConnectedDatabases,E as toDatabaseEnvVarValue};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var t=(a,e)=>c(a,"name",{value:e,configurable:!0});import{STORAGE_PRESETS as u}from"../presets/storagePresets.js";function s(a,...e){const n={};for(const r of e)a[r]!==void 0&&(n[r]=a[r]);return n}t(s,"pickDefined");function b(a,e){const n={name:a,type:e.databaseType,databaseName:e.databaseName,...s(e,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(e.databaseType){case"Instance":return{...n,...s(e,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...n,...s(e,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...n,primaryRegion:e.primaryRegion,...e.secondaryRegions&&e.secondaryRegions.length>0&&{secondaryRegions:e.secondaryRegions},...s(e,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return e}}t(b,"buildRelationalResourcePlan");function m(a){return`${a}Database`}t(m,"defaultRelationalDatabaseName");function f(a,e){return`Database name '${a}' already exists in ${e}. Please choose a different database name.`}t(f,"duplicateDatabaseNameMessage");function p(a,e){const n=a.find(o=>o.name===e.databaseName||o.databaseName===e.databaseName);if(!n)return{ok:!1,message:`Database '${e.databaseName}' not found. Available databases: ${a.map(o=>o.name).join(", ")||"none"}`};if(n.proxy!==void 0&&n.proxy!==!1)return{ok:!1,message:`Database '${n.name}' already has RDS Proxy enabled.`};const r=s(e,"maxConnections","maxIdleConnections","connectionBorrowTimeout","requireTLS");return{ok:!0,database:n,proxyValue:Object.keys(r).length>0?r:{}}}t(p,"resolveProxyAddition");function y(a,e){return{name:a,type:"ClickHouse",databaseName:e.databaseName,...s(e,"instanceType","coldTier","optimiseSchedule","backupSchedule","backupRetentionDays")}}t(y,"buildClickHouseResourcePlan");function R(a,e,n){const r=e.storagePreset??"standard",o=u[r],i=n===0?"":`${n+1}`;return{name:a,bucketName:e.bucketName,variableName:`bucket${i}`,...o,...s(e,"publicReadAccess","websiteHosting","backupVaultTier","versioned","encryption","kmsKeyArn","cors")}}t(R,"buildS3ResourcePlan");export{y as buildClickHouseResourcePlan,b as buildRelationalResourcePlan,R as buildS3ResourcePlan,m as defaultRelationalDatabaseName,f as duplicateDatabaseNameMessage,s as pickDefined,p as resolveProxyAddition};
1
+ var c=Object.defineProperty;var t=(a,e)=>c(a,"name",{value:e,configurable:!0});import{STORAGE_PRESETS as u}from"../presets/storagePresets.js";function s(a,...e){const n={};for(const r of e)a[r]!==void 0&&(n[r]=a[r]);return n}t(s,"pickDefined");function b(a,e){const n={name:a,type:e.databaseType,databaseName:e.databaseName,...s(e,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(e.databaseType){case"Instance":return{...n,...s(e,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...n,...s(e,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...n,primaryRegion:e.primaryRegion,...e.secondaryRegions&&e.secondaryRegions.length>0&&{secondaryRegions:e.secondaryRegions},...s(e,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return e}}t(b,"buildRelationalResourcePlan");function m(a){return`${a}Database`}t(m,"defaultRelationalDatabaseName");function p(a,e){return`Database name '${a}' already exists in ${e}. Please choose a different database name.`}t(p,"duplicateDatabaseNameMessage");function f(a,e){const n=a.find(o=>o.name===e.databaseName||o.databaseName===e.databaseName);if(!n)return{ok:!1,message:`Database '${e.databaseName}' not found. Available databases: ${a.map(o=>o.name).join(", ")||"none"}`};if(n.proxy!==void 0&&n.proxy!==!1)return{ok:!1,message:`Database '${n.name}' already has RDS Proxy enabled.`};const r=s(e,"maxConnections","maxIdleConnections","connectionBorrowTimeout","requireTLS");return{ok:!0,database:n,proxyValue:Object.keys(r).length>0?r:{}}}t(f,"resolveProxyAddition");function y(a,e){return{name:a,type:"ClickHouse",databaseName:e.databaseName,...s(e,"instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays")}}t(y,"buildClickHouseResourcePlan");function g(a,e,n){const r=e.storagePreset??"standard",o=u[r],i=n===0?"":`${n+1}`;return{name:a,bucketName:e.bucketName,variableName:`bucket${i}`,...o,...s(e,"publicReadAccess","websiteHosting","backupVaultTier","versioned","encryption","kmsKeyArn","cors")}}t(g,"buildS3ResourcePlan");export{y as buildClickHouseResourcePlan,b as buildRelationalResourcePlan,g as buildS3ResourcePlan,m as defaultRelationalDatabaseName,p as duplicateDatabaseNameMessage,s as pickDefined,f as resolveProxyAddition};
@@ -9,9 +9,20 @@
9
9
  * The R2 cold tier from the original construct was dropped per D12; only the
10
10
  * S3 cold tier (`{ mode: "s3" }`) is valid.
11
11
  */
12
+ import type { ClickHouseInstanceType } from "@fjall/util/clickhouse";
12
13
  export interface ClickHouseTierPreset {
13
- /** EC2 instance type (default per tier). */
14
- instanceType?: string;
14
+ /** EC2 instance type (default per tier). Typed against the shared
15
+ * vocabulary so a preset naming a type the construct does not support
16
+ * fails to compile — the resilient/enterprise tiers shipped exactly that
17
+ * drift (`m6g.*`), and every scaffold from them died at synth. */
18
+ instanceType?: ClickHouseInstanceType;
19
+ /** EBS data-volume size in GiB (default per tier). */
20
+ storageGb?: number;
21
+ /** Provisioned gp3 IOPS. No tier sets it — the baseline is included in the
22
+ * volume price and the default workload is not IOPS-bound. */
23
+ iops?: number;
24
+ /** Provisioned gp3 throughput in MiB/s. No tier sets it, as with `iops`. */
25
+ throughputMbps?: number;
15
26
  /**
16
27
  * Cold tier configuration. `false` disables; `{ mode: "s3" }` enables an
17
28
  * S3-backed cold tier per D12.
@@ -1 +1 @@
1
- var C=Object.defineProperty;var r=(e,t)=>C(e,"name",{value:t,configurable:!0});import{TIER_NAMES as f}from"../schemas/sharedTypes.js";import{TIER_NAMES as P,CUSTOM_TIER as R,APP_TYPES as G}from"../schemas/sharedTypes.js";const s="service",u="0 4 * * ? *",p="0 5 * * ? *",n=Object.freeze({tinkerer:{displayName:"Tinkerer",description:"Free tier eligible, minimal cost for experimentation",database:{Instance:{instanceType:"t4g.micro",multiAz:!1,proxy:!1,readReplica:!1,publiclyAccessible:!0},Aurora:null,GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"EC2",desiredCount:1,minCapacity:1,maxCapacity:1,ec2Config:{instanceType:"t4g.micro",amiHardwareType:"ARM",minCapacity:1,maxCapacity:1,memoryLimitMiB:400}}],cluster:{directAccess:!0}},lambda:{timeout:30,memory:128}},network:{maxAzs:2,natGateways:!1,flowLogs:!1},backup:!1},lightweight:{displayName:"Lightweight",description:"Streamlined single-AZ deployment for cost efficiency",database:{Instance:{instanceType:"t4g.small",multiAz:!1},Aurora:{readers:!1},GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE_SPOT",cpu:256,memoryLimitMiB:512,desiredCount:1,minCapacity:1,maxCapacity:3}]},lambda:{timeout:30,memory:256}},network:{maxAzs:2,natGateways:{count:1},flowLogs:!1},backup:!1},standard:{displayName:"Standard",description:"Production-ready with sensible defaults",database:{Instance:{instanceType:"t4g.large"},Aurora:{readers:{count:1}},GlobalAurora:{readers:{count:1}},ClickHouse:{instanceType:"t4g.medium",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:512,memoryLimitMiB:1024,desiredCount:2,minCapacity:2,maxCapacity:5}]},lambda:{timeout:60,memory:256}},network:{maxAzs:3,natGateways:{count:1},flowLogs:{},vpcEndpoints:{interface:{ecr:!0}}},backup:!1},resilient:{displayName:"Resilient",description:"High availability with enhanced monitoring and scaling",database:{Instance:{instanceType:"r7g.large",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m6g.large",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:1024,memoryLimitMiB:2048,desiredCount:4,minCapacity:4,maxCapacity:20}]},lambda:{timeout:120,memory:512}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{retentionDays:90},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0}}},backup:{tier:"resilient"}},enterprise:{displayName:"Enterprise",description:"Maximum capability with all features enabled",database:{Instance:{instanceType:"r7g.xlarge",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},readReplica:{}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m6g.xlarge",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:30}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:2048,memoryLimitMiB:4096,desiredCount:6,minCapacity:6,maxCapacity:100}]},lambda:{timeout:300,memory:1024}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{destination:"s3",retentionDays:365},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0,kms:!0,cloudwatchLogs:!0}}},backup:{tier:"enterprise"}}});function E(e,t){return n[e].database[t]}r(E,"getDatabasePreset");function v(e){return n[e].compute.ecs}r(v,"getEcsPreset");function h(e){return n[e].network}r(h,"getNetworkPreset");function T(e){return f.filter(t=>n[t].database[e]!==null)}r(T,"getAvailableTiersForDatabase");function L(e){return T(e).map(t=>({label:n[t].displayName,value:t,description:n[t].description}))}r(L,"getTierOptionsForDatabase");function M(e){switch(e){case"tinkerer":case"lightweight":case"standard":return"Instance";case"resilient":case"enterprise":return"Aurora"}}r(M,"getDefaultDatabaseTypeForTier");function S(e,t){const o=n[e].compute.ecs,i=o.services[0],m=!o.cluster?.directAccess&&o.cluster?.loadBalancer!==!1,y=t.filter(a=>a.serviceType!=="worker").length,b=t.findIndex(a=>a.serviceType!=="worker");return t.map((a,l)=>{const d=l===b,g=a.serviceType==="worker";let c;return m&&!g&&(a.routing?c=a.routing:y>1&&(c={path:d?"/*":`/${a.name.toLowerCase()}/*`,...d?{}:{priority:100+l}})),{name:a.name,capacityProvider:i.capacityProvider,ec2Config:i.ec2Config,cpu:i.cpu,memoryLimitMiB:i.memoryLimitMiB,desiredCount:i.desiredCount,minCapacity:i.minCapacity,maxCapacity:i.maxCapacity,routing:c}})}r(S,"applyTierDefaultsToServices");export{G as APP_TYPES,R as CUSTOM_TIER,P as TIER_NAMES,n as TIER_PRESETS,S as applyTierDefaultsToServices,T as getAvailableTiersForDatabase,E as getDatabasePreset,M as getDefaultDatabaseTypeForTier,v as getEcsPreset,h as getNetworkPreset,L as getTierOptionsForDatabase};
1
+ var C=Object.defineProperty;var r=(e,t)=>C(e,"name",{value:t,configurable:!0});import{TIER_NAMES as f}from"../schemas/sharedTypes.js";import{TIER_NAMES as P,CUSTOM_TIER as R,APP_TYPES as G}from"../schemas/sharedTypes.js";const s="service",u="cron(0 4 * * ? *)",p="cron(0 5 * * ? *)",n=Object.freeze({tinkerer:{displayName:"Tinkerer",description:"Free tier eligible, minimal cost for experimentation",database:{Instance:{instanceType:"t4g.micro",multiAz:!1,proxy:!1,readReplica:!1,publiclyAccessible:!0},Aurora:null,GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"EC2",desiredCount:1,minCapacity:1,maxCapacity:1,ec2Config:{instanceType:"t4g.micro",amiHardwareType:"ARM",minCapacity:1,maxCapacity:1,memoryLimitMiB:400}}],cluster:{directAccess:!0}},lambda:{timeout:30,memory:128}},network:{maxAzs:2,natGateways:!1,flowLogs:!1},backup:!1},lightweight:{displayName:"Lightweight",description:"Streamlined single-AZ deployment for cost efficiency",database:{Instance:{instanceType:"t4g.small",multiAz:!1},Aurora:{readers:!1},GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE_SPOT",cpu:256,memoryLimitMiB:512,desiredCount:1,minCapacity:1,maxCapacity:3}]},lambda:{timeout:30,memory:256}},network:{maxAzs:2,natGateways:{count:1},flowLogs:!1},backup:!1},standard:{displayName:"Standard",description:"Production-ready with sensible defaults",database:{Instance:{instanceType:"t4g.large"},Aurora:{readers:{count:1}},GlobalAurora:{readers:{count:1}},ClickHouse:{instanceType:"t4g.medium",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:512,memoryLimitMiB:1024,desiredCount:2,minCapacity:2,maxCapacity:5}]},lambda:{timeout:60,memory:256}},network:{maxAzs:3,natGateways:{count:1},flowLogs:{},vpcEndpoints:{interface:{ecr:!0}}},backup:!1},resilient:{displayName:"Resilient",description:"High availability with enhanced monitoring and scaling",database:{Instance:{instanceType:"r7g.large",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m7g.large",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:1024,memoryLimitMiB:2048,desiredCount:4,minCapacity:4,maxCapacity:20}]},lambda:{timeout:120,memory:512}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{retentionDays:90},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0}}},backup:{tier:"resilient"}},enterprise:{displayName:"Enterprise",description:"Maximum capability with all features enabled",database:{Instance:{instanceType:"r7g.xlarge",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},readReplica:{}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m7g.xlarge",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:30}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:2048,memoryLimitMiB:4096,desiredCount:6,minCapacity:6,maxCapacity:100}]},lambda:{timeout:300,memory:1024}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{destination:"s3",retentionDays:365},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0,kms:!0,cloudwatchLogs:!0}}},backup:{tier:"enterprise"}}});function E(e,t){return n[e].database[t]}r(E,"getDatabasePreset");function v(e){return n[e].compute.ecs}r(v,"getEcsPreset");function h(e){return n[e].network}r(h,"getNetworkPreset");function T(e){return f.filter(t=>n[t].database[e]!==null)}r(T,"getAvailableTiersForDatabase");function L(e){return T(e).map(t=>({label:n[t].displayName,value:t,description:n[t].description}))}r(L,"getTierOptionsForDatabase");function M(e){switch(e){case"tinkerer":case"lightweight":case"standard":return"Instance";case"resilient":case"enterprise":return"Aurora"}}r(M,"getDefaultDatabaseTypeForTier");function S(e,t){const o=n[e].compute.ecs,i=o.services[0],m=!o.cluster?.directAccess&&o.cluster?.loadBalancer!==!1,y=t.filter(a=>a.serviceType!=="worker").length,b=t.findIndex(a=>a.serviceType!=="worker");return t.map((a,l)=>{const d=l===b,g=a.serviceType==="worker";let c;return m&&!g&&(a.routing?c=a.routing:y>1&&(c={path:d?"/*":`/${a.name.toLowerCase()}/*`,...d?{}:{priority:100+l}})),{name:a.name,capacityProvider:i.capacityProvider,ec2Config:i.ec2Config,cpu:i.cpu,memoryLimitMiB:i.memoryLimitMiB,desiredCount:i.desiredCount,minCapacity:i.minCapacity,maxCapacity:i.maxCapacity,routing:c}})}r(S,"applyTierDefaultsToServices");export{G as APP_TYPES,R as CUSTOM_TIER,P as TIER_NAMES,n as TIER_PRESETS,S as applyTierDefaultsToServices,T as getAvailableTiersForDatabase,E as getDatabasePreset,M as getDefaultDatabaseTypeForTier,v as getEcsPreset,h as getNetworkPreset,L as getTierOptionsForDatabase};
@@ -811,11 +811,15 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
811
811
  type: z.ZodLiteral<"ClickHouse">;
812
812
  databaseName: z.ZodString;
813
813
  instanceType: z.ZodOptional<z.ZodString>;
814
+ storageGb: z.ZodOptional<z.ZodNumber>;
815
+ iops: z.ZodOptional<z.ZodNumber>;
816
+ throughputMbps: z.ZodOptional<z.ZodNumber>;
814
817
  coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
815
818
  mode: z.ZodLiteral<"s3">;
816
819
  }, z.core.$strict>, z.ZodLiteral<false>]>>;
817
820
  optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
818
821
  backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
822
+ backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
819
823
  backupRetentionDays: z.ZodOptional<z.ZodNumber>;
820
824
  variableName: z.ZodOptional<z.ZodString>;
821
825
  extraProperties: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1,7 +1,49 @@
1
1
  import { z } from "zod";
2
2
  export type { DatabaseType } from "./constants.js";
3
- /** Reusable backup retention validation. Range: 1-35 days. */
3
+ /** RDS automated-backup retention. Range: 1-35 days — the AWS cap on the
4
+ * automated-backup mechanism. ClickHouse keeps backups as S3 objects and
5
+ * does not share this ceiling; it has its own schema below. */
4
6
  export declare const BackupRetentionSchema: z.ZodNumber;
7
+ /** ClickHouse data-volume size in GiB. Bounds live in `@fjall/util` because
8
+ * the construct enforces the same pair at synth — see the drift note there. */
9
+ export declare const ClickHouseStorageSchema: z.ZodNumber;
10
+ export type ClickHouseStorage = z.infer<typeof ClickHouseStorageSchema>;
11
+ /** ClickHouse gp3 provisioned IOPS / throughput — the RDS "provisioned
12
+ * IOPS / storage throughput" knobs. Only each value's own band is checkable
13
+ * here; the 4 IOPS per MiB/s and 500 IOPS per GiB couplings need the other
14
+ * value and the size in view, and a discriminated-union member cannot carry
15
+ * a `.refine`, so the construct enforces them at synth with the same bounds. */
16
+ export declare const ClickHouseIopsSchema: z.ZodNumber;
17
+ export type ClickHouseIops = z.infer<typeof ClickHouseIopsSchema>;
18
+ export declare const ClickHouseThroughputSchema: z.ZodNumber;
19
+ export type ClickHouseThroughput = z.infer<typeof ClickHouseThroughputSchema>;
20
+ /** ClickHouse EC2 instance type. The vocabulary lives in `@fjall/util`
21
+ * because the construct keys its hardware-spec table on the same tuple —
22
+ * see the drift note there: the resilient/enterprise presets once shipped
23
+ * `m6g.*` types the construct never supported, so every scaffold from
24
+ * those tiers failed at synth. Validating here surfaces the error at
25
+ * scaffold time with the legal values named. */
26
+ export declare const ClickHouseInstanceTypeSchema: z.ZodEnum<{
27
+ "t4g.medium": "t4g.medium";
28
+ "m7g.medium": "m7g.medium";
29
+ "m8g.medium": "m8g.medium";
30
+ "r7g.medium": "r7g.medium";
31
+ "r8g.medium": "r8g.medium";
32
+ "m7g.large": "m7g.large";
33
+ "m8g.large": "m8g.large";
34
+ "r7g.large": "r7g.large";
35
+ "r8g.large": "r8g.large";
36
+ "m7g.xlarge": "m7g.xlarge";
37
+ "m8g.xlarge": "m8g.xlarge";
38
+ "r7g.xlarge": "r7g.xlarge";
39
+ "r8g.xlarge": "r8g.xlarge";
40
+ }>;
41
+ export type ClickHouseInstanceTypeOption = z.infer<typeof ClickHouseInstanceTypeSchema>;
42
+ /** ClickHouse backup retention in days. Bounds live in `@fjall/util`
43
+ * because the construct enforces the same pair at synth — see the drift
44
+ * note there, which this knob is the reason for. */
45
+ export declare const ClickHouseBackupRetentionSchema: z.ZodNumber;
46
+ export type ClickHouseBackupRetention = z.infer<typeof ClickHouseBackupRetentionSchema>;
5
47
  /** Reusable monitoring interval validation. Must be one of: 0, 1, 5, 10, 15, 30, 60. */
6
48
  export declare const MonitoringIntervalSchema: z.ZodNumber;
7
49
  /** Reusable database port validation. Range: 1024-65535. */
@@ -207,7 +249,7 @@ export declare const DatabaseResourcePlanSchema: z.ZodObject<{
207
249
  * - Instance: instanceType, multiAz, readReplica
208
250
  * - Aurora: writer, readers, backupRetention
209
251
  * - GlobalAurora: primaryRegion (required!), secondaryRegions, enableGlobalWriteForwarding
210
- * - ClickHouse: instanceType, coldTier, optimiseSchedule, backupSchedule, backupRetentionDays
252
+ * - ClickHouse: instanceType, storageGb, iops, throughputMbps, coldTier, optimiseSchedule, backupSchedule, backupVerify, backupRetentionDays
211
253
  */
212
254
  export declare const DatabaseGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
213
255
  appName: z.ZodString;
@@ -400,12 +442,30 @@ export declare const DatabaseGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObje
400
442
  connectToServices: z.ZodOptional<z.ZodArray<z.ZodString>>;
401
443
  }, z.core.$strict>>;
402
444
  databaseType: z.ZodLiteral<"ClickHouse">;
403
- instanceType: z.ZodOptional<z.ZodString>;
445
+ instanceType: z.ZodOptional<z.ZodEnum<{
446
+ "t4g.medium": "t4g.medium";
447
+ "m7g.medium": "m7g.medium";
448
+ "m8g.medium": "m8g.medium";
449
+ "r7g.medium": "r7g.medium";
450
+ "r8g.medium": "r8g.medium";
451
+ "m7g.large": "m7g.large";
452
+ "m8g.large": "m8g.large";
453
+ "r7g.large": "r7g.large";
454
+ "r8g.large": "r8g.large";
455
+ "m7g.xlarge": "m7g.xlarge";
456
+ "m8g.xlarge": "m8g.xlarge";
457
+ "r7g.xlarge": "r7g.xlarge";
458
+ "r8g.xlarge": "r8g.xlarge";
459
+ }>>;
460
+ storageGb: z.ZodOptional<z.ZodNumber>;
461
+ iops: z.ZodOptional<z.ZodNumber>;
462
+ throughputMbps: z.ZodOptional<z.ZodNumber>;
404
463
  coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
405
464
  mode: z.ZodLiteral<"s3">;
406
465
  }, z.core.$strict>, z.ZodLiteral<false>]>>;
407
466
  optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
408
467
  backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
468
+ backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
409
469
  backupRetentionDays: z.ZodOptional<z.ZodNumber>;
410
470
  }, z.core.$strict>], "databaseType">;
411
471
  export declare const DatabaseGeneratorSchemaFromUI: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -599,12 +659,30 @@ export declare const DatabaseGeneratorSchemaFromUI: z.ZodDiscriminatedUnion<[z.Z
599
659
  }, z.core.$strict>>;
600
660
  resourceName: z.ZodString;
601
661
  databaseType: z.ZodLiteral<"ClickHouse">;
602
- instanceType: z.ZodOptional<z.ZodString>;
662
+ instanceType: z.ZodOptional<z.ZodEnum<{
663
+ "t4g.medium": "t4g.medium";
664
+ "m7g.medium": "m7g.medium";
665
+ "m8g.medium": "m8g.medium";
666
+ "r7g.medium": "r7g.medium";
667
+ "r8g.medium": "r8g.medium";
668
+ "m7g.large": "m7g.large";
669
+ "m8g.large": "m8g.large";
670
+ "r7g.large": "r7g.large";
671
+ "r8g.large": "r8g.large";
672
+ "m7g.xlarge": "m7g.xlarge";
673
+ "m8g.xlarge": "m8g.xlarge";
674
+ "r7g.xlarge": "r7g.xlarge";
675
+ "r8g.xlarge": "r8g.xlarge";
676
+ }>>;
677
+ storageGb: z.ZodOptional<z.ZodNumber>;
678
+ iops: z.ZodOptional<z.ZodNumber>;
679
+ throughputMbps: z.ZodOptional<z.ZodNumber>;
603
680
  coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
604
681
  mode: z.ZodLiteral<"s3">;
605
682
  }, z.core.$strict>, z.ZodLiteral<false>]>>;
606
683
  optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
607
684
  backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
685
+ backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
608
686
  backupRetentionDays: z.ZodOptional<z.ZodNumber>;
609
687
  }, z.core.$strict>], "databaseType">;
610
688
  /**
@@ -689,11 +767,15 @@ export declare const ClickHouseResourcePlanSchema: z.ZodObject<{
689
767
  type: z.ZodLiteral<"ClickHouse">;
690
768
  databaseName: z.ZodString;
691
769
  instanceType: z.ZodOptional<z.ZodString>;
770
+ storageGb: z.ZodOptional<z.ZodNumber>;
771
+ iops: z.ZodOptional<z.ZodNumber>;
772
+ throughputMbps: z.ZodOptional<z.ZodNumber>;
692
773
  coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
693
774
  mode: z.ZodLiteral<"s3">;
694
775
  }, z.core.$strict>, z.ZodLiteral<false>]>>;
695
776
  optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
696
777
  backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
778
+ backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
697
779
  backupRetentionDays: z.ZodOptional<z.ZodNumber>;
698
780
  variableName: z.ZodOptional<z.ZodString>;
699
781
  extraProperties: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1 +1 @@
1
- import{z as e}from"zod";import{VALIDATION_PATTERNS as I,VALIDATION_MESSAGES as o}from"../validation/patterns.js";import{DATABASE_TYPES as A,VALID_MONITORING_INTERVALS as M,DATABASE_ENGINES as y,constIncludes as h}from"./constants.js";import{optionalOrDisabled as i,ResourceNameSchema as t,AppNameSchema as c,DatabaseNameSchema as f,ExtraPropertySchema as l}from"./baseSchemas.js";import{RdsAlarmConfigSchema as G}from"./alarmSchemas.js";const a=e.number().int(o.BACKUP_RETENTION.INTEGER).min(1,o.BACKUP_RETENTION.MIN).max(35,o.BACKUP_RETENTION.MAX),p=e.number().int(o.MONITORING_INTERVAL.INTEGER).refine(n=>h(M,n),{message:o.MONITORING_INTERVAL.VALUES}),b=e.number().int(o.DATABASE.PORT.INTEGER).min(1024,o.DATABASE.PORT.MIN).max(65535,o.DATABASE.PORT.MAX),F=e.enum(A).describe(`Database type must be one of: ${A.join(", ")}`),U=e.object({maxConnections:e.number().int(o.MAX_CONNECTIONS.INTEGER).min(1,o.MAX_CONNECTIONS.MIN).max(100,o.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:e.number().int(o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:e.number().int(o.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,o.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,o.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:e.boolean().optional()}).strict().describe("RDS Proxy configuration"),X=e.object({instanceType:e.string().optional(),availabilityZone:e.string().optional()}).strict().describe("Read replica configuration"),B=e.object({automaticallyAfterDays:e.number().int(o.ROTATION.INTEGER).min(1,o.ROTATION.MIN).max(365,o.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),T=e.object({username:e.string().min(1,o.REQUIRED.USERNAME).max(63,o.USERNAME.MAX_LENGTH).optional(),secretRotation:B.optional()}).strict().describe("Database credentials configuration"),R=i(U),d=i(X),P=e.object({scaleWithWriter:e.boolean().optional(),enableDatabaseInsights:e.boolean().optional(),identifierSuffix:e.string().min(1,o.IDENTIFIER_SUFFIX.REQUIRED).max(50,o.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:e.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),m=e.object({enableDatabaseInsights:e.boolean().optional(),identifierSuffix:e.string().min(1,o.IDENTIFIER_SUFFIX.REQUIRED).max(50,o.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:e.string().optional()}).strict().describe("Configuration for Aurora writer instance"),j=e.object({count:e.number().int(o.READER.COUNT.INTEGER).min(0,o.READER.COUNT.MIN).max(15,o.READER.COUNT.MAX).optional(),instances:e.array(P).max(15,o.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:e.boolean().optional()}).strict().refine(n=>!(n.count!==void 0&&n.instances!==void 0),{message:o.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),E=i(j),L=e.object({awsManaged:e.literal(!0)}).strict(),k=e.object({useCMK:e.literal(!0)}).strict(),S=e.union([L,k]),v=e.object({mode:e.enum(["standard","advanced"]).optional(),encryptionKey:S.optional()}).strict().describe("Database Insights configuration"),g=i(v),u=e.object({storageKey:S.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),ne=e.object({name:t,type:F,databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME),instanceType:e.string().optional(),allocatedStorage:e.number().optional(),multiAz:e.boolean().optional(),publiclyAccessible:e.boolean().optional(),databaseInsights:g.optional(),port:b.optional(),deletionProtection:e.boolean().optional(),proxy:R.optional(),credentials:T.optional(),readReplica:d.optional(),encryption:u.optional(),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),primaryRegion:e.string().optional(),secondaryRegions:e.array(e.string()).optional(),globalClusterIdentifier:e.string().optional(),enableGlobalWriteForwarding:e.boolean().optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional(),databaseEngine:e.enum(y).optional(),engineExpression:e.string().optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional(),alarms:G.optional()}).strict(),r=e.object({appName:c,nameProvidedByFlag:e.boolean().optional(),databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME).max(63,o.MAX_LENGTH.DATABASE_NAME).regex(I.DATABASE_NAME,o.DATABASE_NAME),resourceName:t.optional(),connectionConfig:e.object({connectToCompute:e.array(e.string()).optional(),connectToServices:e.array(e.string()).optional()}).strict().optional(),databaseInsights:g.optional(),port:b.optional(),proxy:R.optional(),credentials:T.optional(),encryption:u.optional(),deletionProtection:e.boolean().optional()}).strict(),O={databaseType:e.literal("Instance"),instanceType:e.string().optional(),multiAz:e.boolean().optional(),readReplica:d.optional(),publiclyAccessible:e.boolean().optional(),backupRetention:a.optional(),allocatedStorage:e.number().optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},C={databaseType:e.literal("Aurora"),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},D={databaseType:e.literal("GlobalAurora"),primaryRegion:e.string().min(1,o.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:e.array(e.string()).optional(),globalClusterIdentifier:e.string().optional(),enableGlobalWriteForwarding:e.boolean().optional(),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},_=e.object({appName:c,nameProvidedByFlag:e.boolean().optional(),databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME).max(63,o.MAX_LENGTH.DATABASE_NAME).regex(I.DATABASE_NAME,o.DATABASE_NAME),resourceName:t.optional(),connectionConfig:e.object({connectToCompute:e.array(e.string()).optional(),connectToServices:e.array(e.string()).optional()}).strict().optional()}).strict(),x={databaseType:e.literal("ClickHouse"),instanceType:e.string().optional(),coldTier:e.union([e.object({mode:e.literal("s3")}).strict(),e.literal(!1)]).optional(),optimiseSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupRetentionDays:a.optional()},Y=r.extend(O).strict(),K=r.extend(C).strict(),W=r.extend(D).strict(),w=_.extend(x).strict(),ie=e.discriminatedUnion("databaseType",[Y,K,W,w]),N=r.extend({resourceName:t}).strict(),H=N.extend(O).strict(),Q=N.extend(C).strict(),V=N.extend(D).strict(),z=_.extend({resourceName:t}).strict(),Z=z.extend(x).strict(),re=e.discriminatedUnion("databaseType",[H,Q,V,Z]),se=e.object({appName:c,databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME),maxConnections:e.number().int(o.MAX_CONNECTIONS.INTEGER).min(1,o.MAX_CONNECTIONS.MIN).max(100,o.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:e.number().int(o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:e.number().int(o.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,o.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,o.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:e.boolean().optional(),nameProvidedByFlag:e.boolean().optional()}).strict(),q=["S","N","B"],s=e.object({name:e.string(),type:e.enum(q)}).strict(),ce=e.object({name:t,partitionKey:s,sortKey:s.optional(),globalSecondaryIndexes:e.array(e.object({indexName:e.string(),partitionKey:s,sortKey:s.optional()}).strict()).optional(),ttlAttribute:e.string().optional(),stream:e.boolean().optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional()}).strict(),$=e.object({mode:e.literal("s3")}).strict(),le=e.object({name:t,type:e.literal("ClickHouse"),databaseName:f,instanceType:e.string().optional(),coldTier:e.union([$,e.literal(!1)]).optional(),optimiseSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupRetentionDays:a.optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional()}).strict();export{se as AddProxyGeneratorSchema,P as AuroraReaderConfigSchema,E as AuroraReadersConfigOrFalseSchema,j as AuroraReadersConfigSchema,m as AuroraWriterConfigSchema,L as AwsManagedKeySchema,a as BackupRetentionSchema,le as ClickHouseResourcePlanSchema,T as CredentialsConfigSchema,k as CustomerManagedKeyMarkerSchema,ie as DatabaseGeneratorSchema,re as DatabaseGeneratorSchemaFromUI,g as DatabaseInsightsConfigOrFalseSchema,v as DatabaseInsightsConfigSchema,b as DatabasePortSchema,ne as DatabaseResourcePlanSchema,F as DatabaseTypeSchema,ce as DynamoDBResourcePlanSchema,u as EncryptionConfigSchema,S as EncryptionKeySpecSchema,p as MonitoringIntervalSchema,R as ProxyConfigOrFalseSchema,U as ProxyConfigSchema,d as ReadReplicaConfigOrFalseSchema,X as ReadReplicaConfigSchema,B as SecretRotationConfigSchema};
1
+ import{z as o}from"zod";import{VALIDATION_PATTERNS as N,VALIDATION_MESSAGES as e}from"../validation/patterns.js";import{DATABASE_TYPES as A,VALID_MONITORING_INTERVALS as G,DATABASE_ENGINES as f,constIncludes as P}from"./constants.js";import{optionalOrDisabled as n,ResourceNameSchema as t,AppNameSchema as c,DatabaseNameSchema as X,ExtraPropertySchema as l}from"./baseSchemas.js";import{RdsAlarmConfigSchema as B}from"./alarmSchemas.js";import{CLICKHOUSE_INSTANCE_TYPES as H,CLICKHOUSE_MAX_BACKUP_RETENTION_DAYS as F,CLICKHOUSE_MAX_IOPS as L,CLICKHOUSE_MAX_STORAGE_GB as K,CLICKHOUSE_MAX_THROUGHPUT_MBPS as k,CLICKHOUSE_MIN_BACKUP_RETENTION_DAYS as j,CLICKHOUSE_MIN_IOPS as Y,CLICKHOUSE_MIN_STORAGE_GB as v,CLICKHOUSE_MIN_THROUGHPUT_MBPS as W}from"@fjall/util/clickhouse";const i=o.number().int(e.BACKUP_RETENTION.INTEGER).min(1,e.BACKUP_RETENTION.MIN).max(35,e.BACKUP_RETENTION.MAX),S=o.number().int(e.CLICKHOUSE_STORAGE.INTEGER).min(v,e.CLICKHOUSE_STORAGE.MIN).max(K,e.CLICKHOUSE_STORAGE.MAX),T=o.number().int(e.CLICKHOUSE_IOPS.INTEGER).min(Y,e.CLICKHOUSE_IOPS.MIN).max(L,e.CLICKHOUSE_IOPS.MAX),b=o.number().int(e.CLICKHOUSE_THROUGHPUT.INTEGER).min(W,e.CLICKHOUSE_THROUGHPUT.MIN).max(k,e.CLICKHOUSE_THROUGHPUT.MAX),w=o.enum(H),O=o.number().int(e.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(j,e.CLICKHOUSE_BACKUP_RETENTION.MIN).max(F,e.CLICKHOUSE_BACKUP_RETENTION.MAX),p=o.number().int(e.MONITORING_INTERVAL.INTEGER).refine(a=>P(G,a),{message:e.MONITORING_INTERVAL.VALUES}),R=o.number().int(e.DATABASE.PORT.INTEGER).min(1024,e.DATABASE.PORT.MIN).max(65535,e.DATABASE.PORT.MAX),V=o.enum(A).describe(`Database type must be one of: ${A.join(", ")}`),Q=o.object({maxConnections:o.number().int(e.MAX_CONNECTIONS.INTEGER).min(1,e.MAX_CONNECTIONS.MIN).max(100,e.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:o.number().int(e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:o.number().int(e.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,e.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,e.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:o.boolean().optional()}).strict().describe("RDS Proxy configuration"),z=o.object({instanceType:o.string().optional(),availabilityZone:o.string().optional()}).strict().describe("Read replica configuration"),Z=o.object({automaticallyAfterDays:o.number().int(e.ROTATION.INTEGER).min(1,e.ROTATION.MIN).max(365,e.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),C=o.object({username:o.string().min(1,e.REQUIRED.USERNAME).max(63,e.USERNAME.MAX_LENGTH).optional(),secretRotation:Z.optional()}).strict().describe("Database credentials configuration"),u=n(Q),d=n(z),q=o.object({scaleWithWriter:o.boolean().optional(),enableDatabaseInsights:o.boolean().optional(),identifierSuffix:o.string().min(1,e.IDENTIFIER_SUFFIX.REQUIRED).max(50,e.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:o.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),m=o.object({enableDatabaseInsights:o.boolean().optional(),identifierSuffix:o.string().min(1,e.IDENTIFIER_SUFFIX.REQUIRED).max(50,e.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:o.string().optional()}).strict().describe("Configuration for Aurora writer instance"),$=o.object({count:o.number().int(e.READER.COUNT.INTEGER).min(0,e.READER.COUNT.MIN).max(15,e.READER.COUNT.MAX).optional(),instances:o.array(q).max(15,e.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:o.boolean().optional()}).strict().refine(a=>!(a.count!==void 0&&a.instances!==void 0),{message:e.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),E=n($),J=o.object({awsManaged:o.literal(!0)}).strict(),oo=o.object({useCMK:o.literal(!0)}).strict(),g=o.union([J,oo]),eo=o.object({mode:o.enum(["standard","advanced"]).optional(),encryptionKey:g.optional()}).strict().describe("Database Insights configuration"),_=n(eo),M=o.object({storageKey:g.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),Oo=o.object({name:t,type:V,databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME),instanceType:o.string().optional(),allocatedStorage:o.number().optional(),multiAz:o.boolean().optional(),publiclyAccessible:o.boolean().optional(),databaseInsights:_.optional(),port:R.optional(),deletionProtection:o.boolean().optional(),proxy:u.optional(),credentials:C.optional(),readReplica:d.optional(),encryption:M.optional(),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),primaryRegion:o.string().optional(),secondaryRegions:o.array(o.string()).optional(),globalClusterIdentifier:o.string().optional(),enableGlobalWriteForwarding:o.boolean().optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional(),databaseEngine:o.enum(f).optional(),engineExpression:o.string().optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional(),alarms:B.optional()}).strict(),r=o.object({appName:c,nameProvidedByFlag:o.boolean().optional(),databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME).max(63,e.MAX_LENGTH.DATABASE_NAME).regex(N.DATABASE_NAME,e.DATABASE_NAME),resourceName:t.optional(),connectionConfig:o.object({connectToCompute:o.array(o.string()).optional(),connectToServices:o.array(o.string()).optional()}).strict().optional(),databaseInsights:_.optional(),port:R.optional(),proxy:u.optional(),credentials:C.optional(),encryption:M.optional(),deletionProtection:o.boolean().optional()}).strict(),x={databaseType:o.literal("Instance"),instanceType:o.string().optional(),multiAz:o.boolean().optional(),readReplica:d.optional(),publiclyAccessible:o.boolean().optional(),backupRetention:i.optional(),allocatedStorage:o.number().optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},D={databaseType:o.literal("Aurora"),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},h={databaseType:o.literal("GlobalAurora"),primaryRegion:o.string().min(1,e.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:o.array(o.string()).optional(),globalClusterIdentifier:o.string().optional(),enableGlobalWriteForwarding:o.boolean().optional(),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},U=o.object({appName:c,nameProvidedByFlag:o.boolean().optional(),databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME).max(63,e.MAX_LENGTH.DATABASE_NAME).regex(N.DATABASE_NAME,e.DATABASE_NAME),resourceName:t.optional(),connectionConfig:o.object({connectToCompute:o.array(o.string()).optional(),connectToServices:o.array(o.string()).optional()}).strict().optional()}).strict(),y={databaseType:o.literal("ClickHouse"),instanceType:w.optional(),storageGb:S.optional(),iops:T.optional(),throughputMbps:b.optional(),coldTier:o.union([o.object({mode:o.literal("s3")}).strict(),o.literal(!1)]).optional(),optimiseSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupVerify:o.literal(!1).optional(),backupRetentionDays:O.optional()},to=r.extend(x).strict(),ao=r.extend(D).strict(),no=r.extend(h).strict(),io=U.extend(y).strict(),Ro=o.discriminatedUnion("databaseType",[to,ao,no,io]),I=r.extend({resourceName:t}).strict(),ro=I.extend(x).strict(),so=I.extend(D).strict(),co=I.extend(h).strict(),lo=U.extend({resourceName:t}).strict(),po=lo.extend(y).strict(),Co=o.discriminatedUnion("databaseType",[ro,so,co,po]),uo=o.object({appName:c,databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME),maxConnections:o.number().int(e.MAX_CONNECTIONS.INTEGER).min(1,e.MAX_CONNECTIONS.MIN).max(100,e.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:o.number().int(e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:o.number().int(e.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,e.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,e.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:o.boolean().optional(),nameProvidedByFlag:o.boolean().optional()}).strict(),mo=["S","N","B"],s=o.object({name:o.string(),type:o.enum(mo)}).strict(),go=o.object({name:t,partitionKey:s,sortKey:s.optional(),globalSecondaryIndexes:o.array(o.object({indexName:o.string(),partitionKey:s,sortKey:s.optional()}).strict()).optional(),ttlAttribute:o.string().optional(),stream:o.boolean().optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional()}).strict(),Eo=o.object({mode:o.literal("s3")}).strict(),_o=o.object({name:t,type:o.literal("ClickHouse"),databaseName:X,instanceType:o.string().optional(),storageGb:S.optional(),iops:T.optional(),throughputMbps:b.optional(),coldTier:o.union([Eo,o.literal(!1)]).optional(),optimiseSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupVerify:o.literal(!1).optional(),backupRetentionDays:O.optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional()}).strict();export{uo as AddProxyGeneratorSchema,q as AuroraReaderConfigSchema,E as AuroraReadersConfigOrFalseSchema,$ as AuroraReadersConfigSchema,m as AuroraWriterConfigSchema,J as AwsManagedKeySchema,i as BackupRetentionSchema,O as ClickHouseBackupRetentionSchema,w as ClickHouseInstanceTypeSchema,T as ClickHouseIopsSchema,_o as ClickHouseResourcePlanSchema,S as ClickHouseStorageSchema,b as ClickHouseThroughputSchema,C as CredentialsConfigSchema,oo as CustomerManagedKeyMarkerSchema,Ro as DatabaseGeneratorSchema,Co as DatabaseGeneratorSchemaFromUI,_ as DatabaseInsightsConfigOrFalseSchema,eo as DatabaseInsightsConfigSchema,R as DatabasePortSchema,Oo as DatabaseResourcePlanSchema,V as DatabaseTypeSchema,go as DynamoDBResourcePlanSchema,M as EncryptionConfigSchema,g as EncryptionKeySpecSchema,p as MonitoringIntervalSchema,u as ProxyConfigOrFalseSchema,Q as ProxyConfigSchema,d as ReadReplicaConfigOrFalseSchema,z as ReadReplicaConfigSchema,Z as SecretRotationConfigSchema};
@@ -124,10 +124,30 @@ export declare const VALIDATION_MESSAGES: Readonly<{
124
124
  readonly MAX_LENGTH: "Database name must be 63 characters or less";
125
125
  };
126
126
  };
127
+ readonly CLICKHOUSE_STORAGE: {
128
+ readonly INTEGER: "ClickHouse storage must be a whole number of GiB";
129
+ readonly MIN: "ClickHouse storage must be at least 100 GiB";
130
+ readonly MAX: "ClickHouse storage cannot exceed 16384 GiB (the gp3 ceiling)";
131
+ };
132
+ readonly CLICKHOUSE_IOPS: {
133
+ readonly INTEGER: "ClickHouse iops must be a whole number";
134
+ readonly MIN: "ClickHouse iops must be at least 3000 (the gp3 baseline)";
135
+ readonly MAX: "ClickHouse iops cannot exceed 80000 (the gp3 ceiling)";
136
+ };
137
+ readonly CLICKHOUSE_THROUGHPUT: {
138
+ readonly INTEGER: "ClickHouse throughputMbps must be a whole number of MiB/s";
139
+ readonly MIN: "ClickHouse throughputMbps must be at least 125 MiB/s (the gp3 baseline)";
140
+ readonly MAX: "ClickHouse throughputMbps cannot exceed 2000 MiB/s (the gp3 ceiling)";
141
+ };
127
142
  readonly BACKUP_RETENTION: {
128
143
  readonly INTEGER: "Backup retention must be an integer";
129
144
  readonly MIN: "Backup retention must be at least 1 day";
130
- readonly MAX: "Backup retention cannot exceed 35 days";
145
+ readonly MAX: "Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)";
146
+ };
147
+ readonly CLICKHOUSE_BACKUP_RETENTION: {
148
+ readonly INTEGER: "ClickHouse backup retention must be an integer number of days";
149
+ readonly MIN: "ClickHouse backup retention must be at least 1 day";
150
+ readonly MAX: "ClickHouse backup retention cannot exceed 3650 days";
131
151
  };
132
152
  readonly SQS: {
133
153
  readonly VISIBILITY_TIMEOUT: {
@@ -1 +1 @@
1
- import{SECRET_NAME_ERROR as e,SSM_COMPONENT_ERROR as t}from"@fjall/util";const n=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:e,SSM_COMPONENT:t,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});export{n as VALIDATION_MESSAGES};
1
+ import{SECRET_NAME_ERROR as e,SSM_COMPONENT_ERROR as t}from"@fjall/util";import{CLICKHOUSE_MAX_BACKUP_RETENTION_DAYS as a,CLICKHOUSE_MAX_IOPS as n,CLICKHOUSE_MAX_STORAGE_GB as s,CLICKHOUSE_MAX_THROUGHPUT_MBPS as i,CLICKHOUSE_MIN_BACKUP_RETENTION_DAYS as r,CLICKHOUSE_MIN_IOPS as o,CLICKHOUSE_MIN_STORAGE_GB as c,CLICKHOUSE_MIN_THROUGHPUT_MBPS as E}from"@fjall/util/clickhouse";const M=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:e,SSM_COMPONENT:t,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${c} GiB`,MAX:`ClickHouse storage cannot exceed ${s} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${o} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${n} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${E} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${i} MiB/s (the gp3 ceiling)`},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${r} day`,MAX:`ClickHouse backup retention cannot exceed ${a} days`},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});export{M as VALIDATION_MESSAGES};
@@ -1 +1 @@
1
- export declare const GENERATOR_VERSION = "16.0.1";
1
+ export declare const GENERATOR_VERSION = "17.0.0";
@@ -1 +1 @@
1
- const E="16.0.1";export{E as GENERATOR_VERSION};
1
+ const E="17.0.0";export{E as GENERATOR_VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/generator",
3
- "version": "16.0.1",
3
+ "version": "17.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fjall-tech/fjall.git",
@@ -58,7 +58,7 @@
58
58
  "license": "SEE LICENSE IN LICENSE",
59
59
  "dependencies": {
60
60
  "@babel/parser": "^7.29.8",
61
- "@fjall/util": "^16.0.1",
61
+ "@fjall/util": "^17.0.0",
62
62
  "ast-types": "^0.16.1",
63
63
  "recast": "^0.23.12",
64
64
  "ts-morph": "^28.0.0",