@fjall/generator 0.89.5 → 0.94.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.
- package/LICENSE +50 -21
- package/README.md +28 -0
- package/dist/.minified +1 -0
- package/dist/src/ast/astCdnParser.d.ts +5 -0
- package/dist/src/ast/astCdnParser.js +1 -114
- package/dist/src/ast/astCommonParser.d.ts +6 -17
- package/dist/src/ast/astCommonParser.js +1 -351
- package/dist/src/ast/astComputeConnectionParser.d.ts +18 -0
- package/dist/src/ast/astComputeConnectionParser.js +1 -0
- package/dist/src/ast/astComputeParser.d.ts +6 -0
- package/dist/src/ast/astComputeParser.js +1 -473
- package/dist/src/ast/astComputeParserHelpers.d.ts +21 -0
- package/dist/src/ast/astComputeParserHelpers.js +1 -0
- package/dist/src/ast/astDatabaseParser.d.ts +9 -24
- package/dist/src/ast/astDatabaseParser.js +1 -275
- package/dist/src/ast/astDomainParser.d.ts +139 -0
- package/dist/src/ast/astDomainParser.js +1 -0
- package/dist/src/ast/astDynamoDBParser.d.ts +35 -0
- package/dist/src/ast/astDynamoDBParser.js +1 -0
- package/dist/src/ast/astExpressionEvaluator.d.ts +23 -0
- package/dist/src/ast/astExpressionEvaluator.js +1 -0
- package/dist/src/ast/astInfrastructureParser.d.ts +12 -49
- package/dist/src/ast/astInfrastructureParser.js +1 -552
- package/dist/src/ast/astMessagingParser.d.ts +5 -0
- package/dist/src/ast/astMessagingParser.js +1 -78
- package/dist/src/ast/astNetworkParser.d.ts +6 -0
- package/dist/src/ast/astNetworkParser.js +1 -219
- package/dist/src/ast/astPatternParser.d.ts +6 -0
- package/dist/src/ast/astPatternParser.js +1 -155
- package/dist/src/ast/astPlanConverter.d.ts +11 -0
- package/dist/src/ast/astPlanConverter.js +2 -0
- package/dist/src/ast/astStatementClassifier.d.ts +24 -0
- package/dist/src/ast/astStatementClassifier.js +1 -0
- package/dist/src/ast/astStatementQueries.d.ts +21 -0
- package/dist/src/ast/astStatementQueries.js +3 -0
- package/dist/src/ast/astStorageParser.d.ts +5 -0
- package/dist/src/ast/astStorageParser.js +1 -164
- package/dist/src/ast/astSurgicalModification.js +19 -400
- package/dist/src/ast/astTestHelpers.d.ts +635 -0
- package/dist/src/ast/astTestHelpers.js +1 -0
- package/dist/src/ast/index.d.ts +1 -0
- package/dist/src/ast/index.js +1 -6
- package/dist/src/aws/regions.js +1 -254
- package/dist/src/codemod/_internal.d.ts +12 -0
- package/dist/src/codemod/_internal.js +1 -0
- package/dist/src/codemod/edits/addResource/bodyIndex.d.ts +34 -0
- package/dist/src/codemod/edits/addResource/bodyIndex.js +1 -0
- package/dist/src/codemod/edits/addResource/propertyBuilder.d.ts +7 -0
- package/dist/src/codemod/edits/addResource/propertyBuilder.js +1 -0
- package/dist/src/codemod/edits/addResource.d.ts +9 -0
- package/dist/src/codemod/edits/addResource.js +1 -0
- package/dist/src/codemod/edits/ensureImports.d.ts +26 -0
- package/dist/src/codemod/edits/ensureImports.js +1 -0
- package/dist/src/codemod/edits/findInsertionPosition.d.ts +39 -0
- package/dist/src/codemod/edits/findInsertionPosition.js +1 -0
- package/dist/src/codemod/edits/index.d.ts +5 -0
- package/dist/src/codemod/edits/index.js +1 -0
- package/dist/src/codemod/edits/modifyResource/literalConversion.d.ts +37 -0
- package/dist/src/codemod/edits/modifyResource/literalConversion.js +1 -0
- package/dist/src/codemod/edits/modifyResource.d.ts +9 -0
- package/dist/src/codemod/edits/modifyResource.js +1 -0
- package/dist/src/codemod/edits/removeResource/commentHeuristic.d.ts +31 -0
- package/dist/src/codemod/edits/removeResource/commentHeuristic.js +1 -0
- package/dist/src/codemod/edits/removeResource/importPruning.d.ts +8 -0
- package/dist/src/codemod/edits/removeResource/importPruning.js +1 -0
- package/dist/src/codemod/edits/removeResource.d.ts +10 -0
- package/dist/src/codemod/edits/removeResource.js +1 -0
- package/dist/src/codemod/fileRewriter/builders.d.ts +57 -0
- package/dist/src/codemod/fileRewriter/builders.js +1 -0
- package/dist/src/codemod/fileRewriter/index.d.ts +4 -0
- package/dist/src/codemod/fileRewriter/index.js +1 -0
- package/dist/src/codemod/fileRewriter/locateByRange.d.ts +65 -0
- package/dist/src/codemod/fileRewriter/locateByRange.js +1 -0
- package/dist/src/codemod/fileRewriter/parse.d.ts +18 -0
- package/dist/src/codemod/fileRewriter/parse.js +2 -0
- package/dist/src/codemod/fileRewriter/print.d.ts +46 -0
- package/dist/src/codemod/fileRewriter/print.js +4 -0
- package/dist/src/codemod/historyPaths.d.ts +2 -0
- package/dist/src/codemod/historyPaths.js +1 -0
- package/dist/src/codemod/index.d.ts +7 -0
- package/dist/src/codemod/index.js +1 -0
- package/dist/src/codemod/listResources.d.ts +4 -0
- package/dist/src/codemod/listResources.js +1 -0
- package/dist/src/codemod/registry.d.ts +42 -0
- package/dist/src/codemod/registry.js +1 -0
- package/dist/src/codemod/semanticIndex/findReferences.d.ts +15 -0
- package/dist/src/codemod/semanticIndex/findReferences.js +2 -0
- package/dist/src/codemod/semanticIndex/index.d.ts +4 -0
- package/dist/src/codemod/semanticIndex/index.js +1 -0
- package/dist/src/codemod/semanticIndex/listImports.d.ts +24 -0
- package/dist/src/codemod/semanticIndex/listImports.js +1 -0
- package/dist/src/codemod/semanticIndex/locateByShape.d.ts +28 -0
- package/dist/src/codemod/semanticIndex/locateByShape.js +1 -0
- package/dist/src/codemod/semanticIndex/projectCache.d.ts +14 -0
- package/dist/src/codemod/semanticIndex/projectCache.js +1 -0
- package/dist/src/codemod/types.d.ts +172 -0
- package/dist/src/codemod/types.js +1 -0
- package/dist/src/dns/bindParser.js +2 -224
- package/dist/src/dns/bindWriter.js +3 -52
- package/dist/src/dns/domainFileGenerator.d.ts +20 -0
- package/dist/src/dns/domainFileGenerator.js +207 -0
- package/dist/src/dns/domainRecords.d.ts +164 -0
- package/dist/src/dns/domainRecords.js +1 -0
- package/dist/src/dns/index.d.ts +2 -1
- package/dist/src/dns/index.js +1 -4
- package/dist/src/dns/types.js +1 -52
- package/dist/src/generation/common.js +6 -161
- package/dist/src/generation/compute.js +82 -590
- package/dist/src/generation/database.js +12 -198
- package/dist/src/generation/generatePatternCode.d.ts +58 -0
- package/dist/src/generation/generatePatternCode.js +33 -0
- package/dist/src/generation/index.js +1 -20
- package/dist/src/generation/infrastructure.d.ts +1 -5
- package/dist/src/generation/infrastructure.js +35 -377
- package/dist/src/generation/messagingConnections.js +1 -73
- package/dist/src/generation/storage.d.ts +0 -15
- package/dist/src/generation/storage.js +35 -168
- package/dist/src/generation/storageConnections.js +1 -75
- package/dist/src/planning/generateResourceChange.d.ts +21 -0
- package/dist/src/planning/generateResourceChange.js +1 -0
- package/dist/src/planning/index.d.ts +3 -0
- package/dist/src/planning/index.js +1 -1
- package/dist/src/planning/resourceAddition.d.ts +154 -0
- package/dist/src/planning/resourceAddition.js +1 -0
- package/dist/src/planning/resourceConnections.d.ts +19 -0
- package/dist/src/planning/resourceConnections.js +1 -0
- package/dist/src/planning/resourcePlanning.js +1 -214
- package/dist/src/presets/index.js +1 -3
- package/dist/src/presets/patternTierPresets.js +1 -131
- package/dist/src/presets/storagePresets.js +1 -36
- package/dist/src/presets/tierPresets.d.ts +5 -8
- package/dist/src/presets/tierPresets.js +1 -384
- package/dist/src/presets/tierTypes.d.ts +1 -1
- package/dist/src/presets/tierTypes.js +0 -7
- package/dist/src/schemas/alarmSchemas.d.ts +19 -0
- package/dist/src/schemas/alarmSchemas.js +1 -0
- package/dist/src/schemas/applicationSchemas.d.ts +22 -6
- package/dist/src/schemas/applicationSchemas.js +1 -80
- package/dist/src/schemas/baseSchemas.d.ts +8 -3
- package/dist/src/schemas/baseSchemas.js +2 -248
- package/dist/src/schemas/cdnSchemas.js +1 -62
- package/dist/src/schemas/computeSchemas.d.ts +25 -3
- package/dist/src/schemas/computeSchemas.js +1 -727
- package/dist/src/schemas/constants.d.ts +5 -7
- package/dist/src/schemas/constants.js +1 -218
- package/dist/src/schemas/databaseSchemas.d.ts +6 -1
- package/dist/src/schemas/databaseSchemas.js +1 -366
- package/dist/src/schemas/index.js +1 -3
- package/dist/src/schemas/instanceTypeArchitecture.js +1 -75
- package/dist/src/schemas/messagingSchemas.js +1 -29
- package/dist/src/schemas/networkSchemas.js +1 -125
- package/dist/src/schemas/patternSchemas.d.ts +1 -1
- package/dist/src/schemas/patternSchemas.js +1 -294
- package/dist/src/schemas/resourceSchemas.d.ts +1 -0
- package/dist/src/schemas/resourceSchemas.js +1 -28
- package/dist/src/schemas/sharedTypes.d.ts +18 -0
- package/dist/src/schemas/sharedTypes.js +1 -0
- package/dist/src/schemas/storageSchemas.d.ts +1 -0
- package/dist/src/schemas/storageSchemas.js +1 -119
- package/dist/src/types/Result.js +1 -31
- package/dist/src/util/errorUtils.js +1 -1
- package/dist/src/validation/patterns.d.ts +9 -0
- package/dist/src/validation/patterns.js +1 -369
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +29 -9
- package/dist/src/dns/infrastructureWriter.d.ts +0 -2
- package/dist/src/dns/infrastructureWriter.js +0 -58
|
@@ -1,384 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Tier Presets
|
|
3
|
-
*
|
|
4
|
-
* This file defines the configuration presets for each tier (Tinkerer, Standard,
|
|
5
|
-
* Resilient, Enterprise) across all resource types. Both the `create` flow and
|
|
6
|
-
* `add` flow consume these presets to ensure consistency.
|
|
7
|
-
*
|
|
8
|
-
* Architecture:
|
|
9
|
-
* - TIER_PRESETS defines what each tier means for each resource type
|
|
10
|
-
* - planApplicationResources() uses these during `fjall create`
|
|
11
|
-
* - AddResourceScreen uses these during `fjall add`
|
|
12
|
-
* - Custom mode bypasses presets and prompts for each parameter
|
|
13
|
-
*
|
|
14
|
-
* Type definitions live in ./tierTypes.ts and are re-exported here.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Tier names - ordered from least to most capable/expensive
|
|
18
|
-
* This is the single source of truth for all tier-based configuration.
|
|
19
|
-
*/
|
|
20
|
-
export const TIER_NAMES = [
|
|
21
|
-
"tinkerer",
|
|
22
|
-
"lightweight",
|
|
23
|
-
"standard",
|
|
24
|
-
"resilient",
|
|
25
|
-
"enterprise",
|
|
26
|
-
];
|
|
27
|
-
export const CUSTOM_TIER = "custom";
|
|
28
|
-
export const APP_TYPES = [...TIER_NAMES, CUSTOM_TIER];
|
|
29
|
-
/**
|
|
30
|
-
* Master configuration for all tiers
|
|
31
|
-
*/
|
|
32
|
-
export const TIER_PRESETS = Object.freeze({
|
|
33
|
-
tinkerer: {
|
|
34
|
-
displayName: "Tinkerer",
|
|
35
|
-
description: "Free tier eligible, minimal cost for experimentation",
|
|
36
|
-
database: {
|
|
37
|
-
Instance: {
|
|
38
|
-
instanceType: "t4g.micro",
|
|
39
|
-
multiAz: false,
|
|
40
|
-
proxy: false,
|
|
41
|
-
readReplica: false,
|
|
42
|
-
publiclyAccessible: true,
|
|
43
|
-
},
|
|
44
|
-
Aurora: null,
|
|
45
|
-
GlobalAurora: null,
|
|
46
|
-
},
|
|
47
|
-
compute: {
|
|
48
|
-
ecs: {
|
|
49
|
-
services: [
|
|
50
|
-
{
|
|
51
|
-
name: "service", // Placeholder - overwritten by user input or app-derived name
|
|
52
|
-
capacityProvider: "EC2",
|
|
53
|
-
desiredCount: 1,
|
|
54
|
-
minCapacity: 1,
|
|
55
|
-
maxCapacity: 1,
|
|
56
|
-
ec2Config: {
|
|
57
|
-
instanceType: "t4g.micro",
|
|
58
|
-
amiHardwareType: "ARM",
|
|
59
|
-
minCapacity: 1,
|
|
60
|
-
maxCapacity: 1,
|
|
61
|
-
memoryLimitMiB: 400,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
cluster: { directAccess: true },
|
|
66
|
-
},
|
|
67
|
-
lambda: {
|
|
68
|
-
timeout: 30,
|
|
69
|
-
memory: 128,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
network: {
|
|
73
|
-
maxAzs: 2,
|
|
74
|
-
natGateways: false,
|
|
75
|
-
flowLogs: false,
|
|
76
|
-
},
|
|
77
|
-
backup: false,
|
|
78
|
-
},
|
|
79
|
-
lightweight: {
|
|
80
|
-
displayName: "Lightweight",
|
|
81
|
-
description: "Streamlined single-AZ deployment for cost efficiency",
|
|
82
|
-
database: {
|
|
83
|
-
Instance: {
|
|
84
|
-
instanceType: "t4g.small",
|
|
85
|
-
multiAz: false,
|
|
86
|
-
},
|
|
87
|
-
Aurora: {
|
|
88
|
-
readers: false,
|
|
89
|
-
},
|
|
90
|
-
GlobalAurora: null,
|
|
91
|
-
},
|
|
92
|
-
compute: {
|
|
93
|
-
ecs: {
|
|
94
|
-
services: [
|
|
95
|
-
{
|
|
96
|
-
name: "service", // Placeholder - overwritten by user input or app-derived name
|
|
97
|
-
capacityProvider: "FARGATE_SPOT",
|
|
98
|
-
cpu: 256,
|
|
99
|
-
memoryLimitMiB: 512,
|
|
100
|
-
desiredCount: 1,
|
|
101
|
-
minCapacity: 1,
|
|
102
|
-
maxCapacity: 3,
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
lambda: {
|
|
107
|
-
timeout: 30,
|
|
108
|
-
memory: 256,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
network: {
|
|
112
|
-
maxAzs: 2,
|
|
113
|
-
natGateways: { count: 1 },
|
|
114
|
-
flowLogs: false,
|
|
115
|
-
},
|
|
116
|
-
backup: false,
|
|
117
|
-
},
|
|
118
|
-
standard: {
|
|
119
|
-
displayName: "Standard",
|
|
120
|
-
description: "Production-ready with sensible defaults",
|
|
121
|
-
database: {
|
|
122
|
-
Instance: {
|
|
123
|
-
instanceType: "t4g.large",
|
|
124
|
-
},
|
|
125
|
-
Aurora: {
|
|
126
|
-
readers: { count: 1 },
|
|
127
|
-
},
|
|
128
|
-
GlobalAurora: {
|
|
129
|
-
readers: { count: 1 },
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
compute: {
|
|
133
|
-
ecs: {
|
|
134
|
-
services: [
|
|
135
|
-
{
|
|
136
|
-
name: "service", // Placeholder - overwritten by user input or app-derived name
|
|
137
|
-
capacityProvider: "FARGATE",
|
|
138
|
-
cpu: 512,
|
|
139
|
-
memoryLimitMiB: 1024,
|
|
140
|
-
desiredCount: 2,
|
|
141
|
-
minCapacity: 2,
|
|
142
|
-
maxCapacity: 5,
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
lambda: {
|
|
147
|
-
timeout: 60,
|
|
148
|
-
memory: 256,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
network: {
|
|
152
|
-
maxAzs: 3,
|
|
153
|
-
natGateways: { count: 1 },
|
|
154
|
-
flowLogs: {},
|
|
155
|
-
vpcEndpoints: {
|
|
156
|
-
interface: { ecr: true },
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
// App-level tiers below resilient opt out of AWS Backup. Pattern tier presets
|
|
160
|
-
// define their own { tier: "standard" } because patterns always include backup
|
|
161
|
-
// from standard upward — see patternTierPresets.ts.
|
|
162
|
-
backup: false,
|
|
163
|
-
},
|
|
164
|
-
resilient: {
|
|
165
|
-
displayName: "Resilient",
|
|
166
|
-
description: "High availability with enhanced monitoring and scaling",
|
|
167
|
-
database: {
|
|
168
|
-
Instance: {
|
|
169
|
-
instanceType: "r7g.large",
|
|
170
|
-
encryption: { storageKey: { useCMK: true } },
|
|
171
|
-
databaseInsights: {
|
|
172
|
-
mode: "advanced",
|
|
173
|
-
encryptionKey: { useCMK: true },
|
|
174
|
-
},
|
|
175
|
-
proxy: { requireTLS: true },
|
|
176
|
-
},
|
|
177
|
-
Aurora: {
|
|
178
|
-
readers: { count: 2 },
|
|
179
|
-
encryption: { storageKey: { useCMK: true } },
|
|
180
|
-
databaseInsights: {
|
|
181
|
-
mode: "advanced",
|
|
182
|
-
encryptionKey: { useCMK: true },
|
|
183
|
-
},
|
|
184
|
-
proxy: { requireTLS: true },
|
|
185
|
-
backupRetention: 30,
|
|
186
|
-
},
|
|
187
|
-
GlobalAurora: {
|
|
188
|
-
readers: { count: 2 },
|
|
189
|
-
encryption: { storageKey: { useCMK: true } },
|
|
190
|
-
databaseInsights: {
|
|
191
|
-
mode: "advanced",
|
|
192
|
-
encryptionKey: { useCMK: true },
|
|
193
|
-
},
|
|
194
|
-
proxy: { requireTLS: true },
|
|
195
|
-
backupRetention: 30,
|
|
196
|
-
enableGlobalWriteForwarding: true,
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
compute: {
|
|
200
|
-
ecs: {
|
|
201
|
-
services: [
|
|
202
|
-
{
|
|
203
|
-
name: "service", // Placeholder - overwritten by user input or app-derived name
|
|
204
|
-
capacityProvider: "FARGATE",
|
|
205
|
-
cpu: 1024,
|
|
206
|
-
memoryLimitMiB: 2048,
|
|
207
|
-
desiredCount: 4,
|
|
208
|
-
minCapacity: 4,
|
|
209
|
-
maxCapacity: 20,
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
},
|
|
213
|
-
lambda: {
|
|
214
|
-
timeout: 120,
|
|
215
|
-
memory: 512,
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
network: {
|
|
219
|
-
maxAzs: 3,
|
|
220
|
-
natGateways: { count: 3 },
|
|
221
|
-
flowLogs: { retentionDays: 90 },
|
|
222
|
-
vpcEndpoints: {
|
|
223
|
-
interface: { ecr: true, secretsManager: true },
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
backup: { tier: "resilient" },
|
|
227
|
-
},
|
|
228
|
-
enterprise: {
|
|
229
|
-
displayName: "Enterprise",
|
|
230
|
-
description: "Maximum capability with all features enabled",
|
|
231
|
-
database: {
|
|
232
|
-
Instance: {
|
|
233
|
-
instanceType: "r6g.xlarge",
|
|
234
|
-
encryption: { storageKey: { useCMK: true } },
|
|
235
|
-
databaseInsights: {
|
|
236
|
-
mode: "advanced",
|
|
237
|
-
encryptionKey: { useCMK: true },
|
|
238
|
-
},
|
|
239
|
-
proxy: { requireTLS: true },
|
|
240
|
-
readReplica: {},
|
|
241
|
-
},
|
|
242
|
-
Aurora: {
|
|
243
|
-
readers: { count: 2 },
|
|
244
|
-
encryption: { storageKey: { useCMK: true } },
|
|
245
|
-
databaseInsights: {
|
|
246
|
-
mode: "advanced",
|
|
247
|
-
encryptionKey: { useCMK: true },
|
|
248
|
-
},
|
|
249
|
-
proxy: { requireTLS: true },
|
|
250
|
-
backupRetention: 35,
|
|
251
|
-
},
|
|
252
|
-
GlobalAurora: {
|
|
253
|
-
readers: { count: 2 },
|
|
254
|
-
encryption: { storageKey: { useCMK: true } },
|
|
255
|
-
databaseInsights: {
|
|
256
|
-
mode: "advanced",
|
|
257
|
-
encryptionKey: { useCMK: true },
|
|
258
|
-
},
|
|
259
|
-
proxy: { requireTLS: true },
|
|
260
|
-
backupRetention: 35,
|
|
261
|
-
enableGlobalWriteForwarding: true,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
compute: {
|
|
265
|
-
ecs: {
|
|
266
|
-
services: [
|
|
267
|
-
{
|
|
268
|
-
name: "service", // Placeholder - overwritten by user input or app-derived name
|
|
269
|
-
capacityProvider: "FARGATE",
|
|
270
|
-
cpu: 2048,
|
|
271
|
-
memoryLimitMiB: 4096,
|
|
272
|
-
desiredCount: 6,
|
|
273
|
-
minCapacity: 6,
|
|
274
|
-
maxCapacity: 100,
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
},
|
|
278
|
-
lambda: {
|
|
279
|
-
timeout: 300,
|
|
280
|
-
memory: 1024,
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
network: {
|
|
284
|
-
maxAzs: 3,
|
|
285
|
-
natGateways: { count: 3 },
|
|
286
|
-
flowLogs: { destination: "s3", retentionDays: 365 },
|
|
287
|
-
vpcEndpoints: {
|
|
288
|
-
interface: {
|
|
289
|
-
ecr: true,
|
|
290
|
-
secretsManager: true,
|
|
291
|
-
kms: true,
|
|
292
|
-
cloudwatchLogs: true,
|
|
293
|
-
},
|
|
294
|
-
},
|
|
295
|
-
},
|
|
296
|
-
backup: { tier: "enterprise" },
|
|
297
|
-
},
|
|
298
|
-
});
|
|
299
|
-
export function getDatabasePreset(tier, databaseType) {
|
|
300
|
-
return TIER_PRESETS[tier].database[databaseType];
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Get ECS preset for a specific tier
|
|
304
|
-
*/
|
|
305
|
-
export function getEcsPreset(tier) {
|
|
306
|
-
return TIER_PRESETS[tier].compute.ecs;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Get network preset for a specific tier
|
|
310
|
-
*/
|
|
311
|
-
export function getNetworkPreset(tier) {
|
|
312
|
-
return TIER_PRESETS[tier].network;
|
|
313
|
-
}
|
|
314
|
-
export function getAvailableTiersForDatabase(databaseType) {
|
|
315
|
-
return TIER_NAMES.filter((tier) => TIER_PRESETS[tier].database[databaseType] !== null);
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Get tier options formatted for UI Select component
|
|
319
|
-
*/
|
|
320
|
-
export function getTierOptionsForDatabase(databaseType) {
|
|
321
|
-
return getAvailableTiersForDatabase(databaseType).map((tier) => ({
|
|
322
|
-
label: TIER_PRESETS[tier].displayName,
|
|
323
|
-
value: tier,
|
|
324
|
-
description: TIER_PRESETS[tier].description,
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Get the default database type for a tier
|
|
329
|
-
*/
|
|
330
|
-
export function getDefaultDatabaseTypeForTier(tier) {
|
|
331
|
-
switch (tier) {
|
|
332
|
-
case "tinkerer":
|
|
333
|
-
case "lightweight":
|
|
334
|
-
case "standard":
|
|
335
|
-
return "Instance";
|
|
336
|
-
case "resilient":
|
|
337
|
-
case "enterprise":
|
|
338
|
-
return "Aurora";
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Apply tier defaults to user-provided services.
|
|
343
|
-
* Takes user service names and applies the tier's cpu, memory, scaling,
|
|
344
|
-
* capacityProvider, and ec2Config defaults.
|
|
345
|
-
*/
|
|
346
|
-
export function applyTierDefaultsToServices(tier, userServices) {
|
|
347
|
-
const tierPreset = TIER_PRESETS[tier];
|
|
348
|
-
const ecsPreset = tierPreset.compute.ecs;
|
|
349
|
-
const templateService = ecsPreset.services[0];
|
|
350
|
-
// Only add routing if tier has a load balancer (not directAccess)
|
|
351
|
-
const hasLoadBalancer = !ecsPreset.cluster?.directAccess &&
|
|
352
|
-
ecsPreset.cluster?.loadBalancer !== false;
|
|
353
|
-
return userServices.map((userService, index) => {
|
|
354
|
-
const isFirstService = index === 0;
|
|
355
|
-
// Build routing config only if tier supports load balancer AND multiple services
|
|
356
|
-
// Single service doesn't need routing - ALB routes all traffic to it automatically
|
|
357
|
-
let routing;
|
|
358
|
-
if (hasLoadBalancer) {
|
|
359
|
-
// Use provided routing if available
|
|
360
|
-
if (userService.routing) {
|
|
361
|
-
routing = userService.routing;
|
|
362
|
-
}
|
|
363
|
-
else if (userServices.length > 1) {
|
|
364
|
-
// Multiple services need routing to differentiate traffic
|
|
365
|
-
routing = {
|
|
366
|
-
path: isFirstService ? "/*" : `/${userService.name.toLowerCase()}/*`,
|
|
367
|
-
...(isFirstService ? {} : { priority: 100 + index }),
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
// Single service: no routing needed (undefined)
|
|
371
|
-
}
|
|
372
|
-
return {
|
|
373
|
-
name: userService.name,
|
|
374
|
-
capacityProvider: templateService.capacityProvider,
|
|
375
|
-
ec2Config: templateService.ec2Config,
|
|
376
|
-
cpu: templateService.cpu,
|
|
377
|
-
memoryLimitMiB: templateService.memoryLimitMiB,
|
|
378
|
-
desiredCount: templateService.desiredCount,
|
|
379
|
-
minCapacity: templateService.minCapacity,
|
|
380
|
-
maxCapacity: templateService.maxCapacity,
|
|
381
|
-
routing,
|
|
382
|
-
};
|
|
383
|
-
});
|
|
384
|
-
}
|
|
1
|
+
import{TIER_NAMES as p}from"../schemas/sharedTypes.js";import{TIER_NAMES as v,CUSTOM_TIER as w,APP_TYPES as M}from"../schemas/sharedTypes.js";const r=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},compute:{ecs:{services:[{name:"service",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},compute:{ecs:{services:[{name:"service",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}}},compute:{ecs:{services:[{name:"service",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}},compute:{ecs:{services:[{name:"service",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}},compute:{ecs:{services:[{name:"service",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 y(e,a){return r[e].database[a]}function g(e){return r[e].compute.ecs}function b(e){return r[e].network}function m(e){return p.filter(a=>r[a].database[e]!==null)}function f(e){return m(e).map(a=>({label:r[a].displayName,value:a,description:r[a].description}))}function C(e){switch(e){case"tinkerer":case"lightweight":case"standard":return"Instance";case"resilient":case"enterprise":return"Aurora"}}function A(e,a){const n=r[e].compute.ecs,t=n.services[0],u=!n.cluster?.directAccess&&n.cluster?.loadBalancer!==!1;return a.map((i,o)=>{const c=o===0;let s;return u&&(i.routing?s=i.routing:a.length>1&&(s={path:c?"/*":`/${i.name.toLowerCase()}/*`,...c?{}:{priority:100+o}})),{name:i.name,capacityProvider:t.capacityProvider,ec2Config:t.ec2Config,cpu:t.cpu,memoryLimitMiB:t.memoryLimitMiB,desiredCount:t.desiredCount,minCapacity:t.minCapacity,maxCapacity:t.maxCapacity,routing:s}})}export{M as APP_TYPES,w as CUSTOM_TIER,v as TIER_NAMES,r as TIER_PRESETS,A as applyTierDefaultsToServices,m as getAvailableTiersForDatabase,y as getDatabasePreset,C as getDefaultDatabaseTypeForTier,g as getEcsPreset,b as getNetworkPreset,f as getTierOptionsForDatabase};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* All interfaces used by tier presets, pattern tier presets, and downstream
|
|
5
5
|
* consumers. Extracted from tierPresets.ts for maintainability.
|
|
6
6
|
*/
|
|
7
|
-
import type { EcsCapacityProvider, BackupVaultTier } from "../schemas/
|
|
7
|
+
import type { EcsCapacityProvider, BackupVaultTier } from "../schemas/sharedTypes.js";
|
|
8
8
|
import type { WarmPool } from "../schemas/computeSchemas.js";
|
|
9
9
|
/**
|
|
10
10
|
* Proxy configuration for tier presets
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EcsServiceAlarmConfigSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
3
|
+
cpuThreshold: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
memoryThreshold: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
http5xxThreshold: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strict>]>;
|
|
8
|
+
export declare const RdsAlarmConfigSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
9
|
+
cpuThreshold: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
freeStorageThresholdGiB: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
connectionsThreshold: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strict>]>;
|
|
13
|
+
export declare const LambdaAlarmConfigSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
14
|
+
errorRateThreshold: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
durationThresholdPercent: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strict>]>;
|
|
17
|
+
export type EcsServiceAlarmConfig = z.infer<typeof EcsServiceAlarmConfigSchema>;
|
|
18
|
+
export type RdsAlarmConfig = z.infer<typeof RdsAlarmConfigSchema>;
|
|
19
|
+
export type LambdaAlarmConfig = z.infer<typeof LambdaAlarmConfigSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as o}from"zod";import{VALIDATION_MESSAGES as n}from"../validation/patterns.js";const e=o.number().min(1,n.ALARM.PERCENTAGE.MIN).max(100,n.ALARM.PERCENTAGE.MAX),r=o.number().min(1,n.ALARM.FREE_STORAGE_GIB.MIN),a=o.union([o.literal(!1),o.object({cpuThreshold:e.optional(),memoryThreshold:e.optional(),runningTasksMinimum:o.number().int().min(0).optional(),http5xxThreshold:e.optional()}).strict()]),l=o.union([o.literal(!1),o.object({cpuThreshold:e.optional(),freeStorageThresholdGiB:r.optional(),connectionsThreshold:o.number().int().min(1).optional()}).strict()]),h=o.union([o.literal(!1),o.object({errorRateThreshold:e.optional(),durationThresholdPercent:e.optional()}).strict()]);export{a as EcsServiceAlarmConfigSchema,h as LambdaAlarmConfigSchema,l as RdsAlarmConfigSchema};
|
|
@@ -7,12 +7,12 @@ import { z } from "zod";
|
|
|
7
7
|
export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
8
8
|
appName: z.ZodString;
|
|
9
9
|
type: z.ZodEnum<{
|
|
10
|
-
custom: "custom";
|
|
11
10
|
standard: "standard";
|
|
12
11
|
resilient: "resilient";
|
|
13
12
|
enterprise: "enterprise";
|
|
14
13
|
tinkerer: "tinkerer";
|
|
15
14
|
lightweight: "lightweight";
|
|
15
|
+
custom: "custom";
|
|
16
16
|
}>;
|
|
17
17
|
pattern: z.ZodOptional<z.ZodEnum<{
|
|
18
18
|
payload: "payload";
|
|
@@ -350,9 +350,9 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
350
350
|
}>;
|
|
351
351
|
databaseName: z.ZodString;
|
|
352
352
|
instanceType: z.ZodOptional<z.ZodString>;
|
|
353
|
+
allocatedStorage: z.ZodOptional<z.ZodNumber>;
|
|
353
354
|
multiAz: z.ZodOptional<z.ZodBoolean>;
|
|
354
355
|
publiclyAccessible: z.ZodOptional<z.ZodBoolean>;
|
|
355
|
-
enableSecretRotation: z.ZodOptional<z.ZodBoolean>;
|
|
356
356
|
databaseInsights: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
|
|
357
357
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
358
358
|
standard: "standard";
|
|
@@ -423,6 +423,11 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
423
423
|
key: z.ZodString;
|
|
424
424
|
sourceText: z.ZodString;
|
|
425
425
|
}, z.core.$strict>>>;
|
|
426
|
+
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
427
|
+
cpuThreshold: z.ZodOptional<z.ZodNumber>;
|
|
428
|
+
freeStorageThresholdGiB: z.ZodOptional<z.ZodNumber>;
|
|
429
|
+
connectionsThreshold: z.ZodOptional<z.ZodNumber>;
|
|
430
|
+
}, z.core.$strict>]>>;
|
|
426
431
|
}, z.core.$strict>>;
|
|
427
432
|
s3: z.ZodArray<z.ZodObject<{
|
|
428
433
|
name: z.ZodString;
|
|
@@ -458,6 +463,7 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
458
463
|
immutable: z.ZodOptional<z.ZodBoolean>;
|
|
459
464
|
}, z.core.$strict>>;
|
|
460
465
|
}, z.core.$strict>>;
|
|
466
|
+
retain: z.ZodOptional<z.ZodBoolean>;
|
|
461
467
|
stackPlacement: z.ZodOptional<z.ZodEnum<{
|
|
462
468
|
storage: "storage";
|
|
463
469
|
compute: "compute";
|
|
@@ -572,6 +578,12 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
572
578
|
key: z.ZodString;
|
|
573
579
|
sourceText: z.ZodString;
|
|
574
580
|
}, z.core.$strict>>>;
|
|
581
|
+
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
582
|
+
cpuThreshold: z.ZodOptional<z.ZodNumber>;
|
|
583
|
+
memoryThreshold: z.ZodOptional<z.ZodNumber>;
|
|
584
|
+
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
http5xxThreshold: z.ZodOptional<z.ZodNumber>;
|
|
586
|
+
}, z.core.$strict>]>>;
|
|
575
587
|
}, z.core.$strict>>>;
|
|
576
588
|
dockerfilePath: z.ZodOptional<z.ZodString>;
|
|
577
589
|
deployment: z.ZodOptional<z.ZodEnum<{
|
|
@@ -599,8 +611,8 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
599
611
|
}, z.core.$strict>]>]>>>;
|
|
600
612
|
eventSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
601
613
|
sourceType: z.ZodEnum<{
|
|
602
|
-
sqs: "sqs";
|
|
603
614
|
dynamodb: "dynamodb";
|
|
615
|
+
sqs: "sqs";
|
|
604
616
|
eventbridge: "eventbridge";
|
|
605
617
|
}>;
|
|
606
618
|
sourceRef: z.ZodString;
|
|
@@ -628,6 +640,10 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
628
640
|
functionName: z.ZodOptional<z.ZodString>;
|
|
629
641
|
ssmSecrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
630
642
|
ssmSecretsPath: z.ZodOptional<z.ZodString>;
|
|
643
|
+
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
644
|
+
errorRateThreshold: z.ZodOptional<z.ZodNumber>;
|
|
645
|
+
durationThresholdPercent: z.ZodOptional<z.ZodNumber>;
|
|
646
|
+
}, z.core.$strict>]>>;
|
|
631
647
|
instanceType: z.ZodOptional<z.ZodString & z.ZodType<"t3.nano" | "t3.micro" | "t3.small" | "t3.medium" | "t3.large" | "t3.xlarge" | "t3.2xlarge" | "t3a.nano" | "t3a.micro" | "t3a.small" | "t3a.medium" | "t3a.large" | "t3a.xlarge" | "t3a.2xlarge" | "t4g.nano" | "t4g.micro" | "t4g.small" | "t4g.medium" | "t4g.large" | "t4g.xlarge" | "t4g.2xlarge" | "c5.large" | "c5.xlarge" | "c5.2xlarge" | "c5.4xlarge" | "c5.9xlarge" | "c5.12xlarge" | "c5.18xlarge" | "c5.24xlarge" | "c5a.large" | "c5a.xlarge" | "c5a.2xlarge" | "c5a.4xlarge" | "c5a.8xlarge" | "c5a.12xlarge" | "c5a.16xlarge" | "c5a.24xlarge" | "c6g.medium" | "c6g.large" | "c6g.xlarge" | "c6g.2xlarge" | "c6g.4xlarge" | "c6g.8xlarge" | "c6g.12xlarge" | "c6g.16xlarge" | "r5.large" | "r5.xlarge" | "r5.2xlarge" | "r5.4xlarge" | "r5.8xlarge" | "r5.12xlarge" | "r5.16xlarge" | "r5.24xlarge" | "r5a.large" | "r5a.xlarge" | "r5a.2xlarge" | "r5a.4xlarge" | "r5a.8xlarge" | "r5a.12xlarge" | "r5a.16xlarge" | "r5a.24xlarge" | "r6g.medium" | "r6g.large" | "r6g.xlarge" | "r6g.2xlarge" | "r6g.4xlarge" | "r6g.8xlarge" | "r6g.12xlarge" | "r6g.16xlarge" | "i3.large" | "i3.xlarge" | "i3.2xlarge" | "i3.4xlarge" | "i3.8xlarge" | "i3.16xlarge" | "p3.2xlarge" | "p3.8xlarge" | "p3.16xlarge" | "g4dn.xlarge" | "g4dn.2xlarge" | "g4dn.4xlarge" | "g4dn.8xlarge" | "g4dn.12xlarge" | "g4dn.16xlarge" | "m5.large" | "m5.xlarge" | "m5.2xlarge" | "m5.4xlarge" | "m5.8xlarge" | "m5.12xlarge" | "m5.16xlarge" | "m5.24xlarge" | "m5a.large" | "m5a.xlarge" | "m5a.2xlarge" | "m5a.4xlarge" | "m5a.8xlarge" | "m5a.12xlarge" | "m5a.16xlarge" | "m5a.24xlarge", string, z.core.$ZodTypeInternals<"t3.nano" | "t3.micro" | "t3.small" | "t3.medium" | "t3.large" | "t3.xlarge" | "t3.2xlarge" | "t3a.nano" | "t3a.micro" | "t3a.small" | "t3a.medium" | "t3a.large" | "t3a.xlarge" | "t3a.2xlarge" | "t4g.nano" | "t4g.micro" | "t4g.small" | "t4g.medium" | "t4g.large" | "t4g.xlarge" | "t4g.2xlarge" | "c5.large" | "c5.xlarge" | "c5.2xlarge" | "c5.4xlarge" | "c5.9xlarge" | "c5.12xlarge" | "c5.18xlarge" | "c5.24xlarge" | "c5a.large" | "c5a.xlarge" | "c5a.2xlarge" | "c5a.4xlarge" | "c5a.8xlarge" | "c5a.12xlarge" | "c5a.16xlarge" | "c5a.24xlarge" | "c6g.medium" | "c6g.large" | "c6g.xlarge" | "c6g.2xlarge" | "c6g.4xlarge" | "c6g.8xlarge" | "c6g.12xlarge" | "c6g.16xlarge" | "r5.large" | "r5.xlarge" | "r5.2xlarge" | "r5.4xlarge" | "r5.8xlarge" | "r5.12xlarge" | "r5.16xlarge" | "r5.24xlarge" | "r5a.large" | "r5a.xlarge" | "r5a.2xlarge" | "r5a.4xlarge" | "r5a.8xlarge" | "r5a.12xlarge" | "r5a.16xlarge" | "r5a.24xlarge" | "r6g.medium" | "r6g.large" | "r6g.xlarge" | "r6g.2xlarge" | "r6g.4xlarge" | "r6g.8xlarge" | "r6g.12xlarge" | "r6g.16xlarge" | "i3.large" | "i3.xlarge" | "i3.2xlarge" | "i3.4xlarge" | "i3.8xlarge" | "i3.16xlarge" | "p3.2xlarge" | "p3.8xlarge" | "p3.16xlarge" | "g4dn.xlarge" | "g4dn.2xlarge" | "g4dn.4xlarge" | "g4dn.8xlarge" | "g4dn.12xlarge" | "g4dn.16xlarge" | "m5.large" | "m5.xlarge" | "m5.2xlarge" | "m5.4xlarge" | "m5.8xlarge" | "m5.12xlarge" | "m5.16xlarge" | "m5.24xlarge" | "m5a.large" | "m5a.xlarge" | "m5a.2xlarge" | "m5a.4xlarge" | "m5a.8xlarge" | "m5a.12xlarge" | "m5a.16xlarge" | "m5a.24xlarge", string>>>;
|
|
632
648
|
enableSSH: z.ZodOptional<z.ZodBoolean>;
|
|
633
649
|
keyName: z.ZodOptional<z.ZodString>;
|
|
@@ -735,10 +751,10 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
735
751
|
afterManagedResource: z.ZodOptional<z.ZodObject<{
|
|
736
752
|
type: z.ZodEnum<{
|
|
737
753
|
custom: "custom";
|
|
738
|
-
pattern: "pattern";
|
|
739
754
|
storage: "storage";
|
|
740
755
|
database: "database";
|
|
741
756
|
compute: "compute";
|
|
757
|
+
pattern: "pattern";
|
|
742
758
|
import: "import";
|
|
743
759
|
"app-init": "app-init";
|
|
744
760
|
tags: "tags";
|
|
@@ -762,22 +778,22 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
762
778
|
export declare const ApplicationGeneratorSchema: z.ZodObject<{
|
|
763
779
|
name: z.ZodString;
|
|
764
780
|
type: z.ZodEnum<{
|
|
765
|
-
custom: "custom";
|
|
766
781
|
standard: "standard";
|
|
767
782
|
resilient: "resilient";
|
|
768
783
|
enterprise: "enterprise";
|
|
769
784
|
tinkerer: "tinkerer";
|
|
770
785
|
lightweight: "lightweight";
|
|
786
|
+
custom: "custom";
|
|
771
787
|
}>;
|
|
772
788
|
pattern: z.ZodOptional<z.ZodEnum<{
|
|
773
789
|
payload: "payload";
|
|
774
790
|
nextjs: "nextjs";
|
|
775
791
|
}>>;
|
|
776
792
|
patternTier: z.ZodOptional<z.ZodEnum<{
|
|
777
|
-
custom: "custom";
|
|
778
793
|
standard: "standard";
|
|
779
794
|
resilient: "resilient";
|
|
780
795
|
lightweight: "lightweight";
|
|
796
|
+
custom: "custom";
|
|
781
797
|
}>>;
|
|
782
798
|
patternDomain: z.ZodOptional<z.ZodString>;
|
|
783
799
|
customDatabase: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,80 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VALIDATION_MESSAGES } from "../validation/patterns.js";
|
|
3
|
-
import { AppNameSchema, AppTypeSchema, PatternSchema, CustomCodeBlockSchema, BackupConfigSchema, TunnelConfigSchema, } from "./baseSchemas.js";
|
|
4
|
-
import { DatabaseResourcePlanSchema } from "./databaseSchemas.js";
|
|
5
|
-
import { NetworkResourcePlanSchema, AdditionalNetworkResourcePlanSchema, NetworkConfigSchema, } from "./networkSchemas.js";
|
|
6
|
-
import { S3ResourcePlanSchema } from "./storageSchemas.js";
|
|
7
|
-
import { SQSResourcePlanSchema } from "./messagingSchemas.js";
|
|
8
|
-
import { CDNResourcePlanSchema } from "./cdnSchemas.js";
|
|
9
|
-
import { ComputeResourcePlanSchema, ApplicationServiceConfigSchema, } from "./computeSchemas.js";
|
|
10
|
-
import { DynamoDBResourcePlanSchema } from "./databaseSchemas.js";
|
|
11
|
-
import { PatternConfigSchema, PatternTierSchema, CustomPatternDatabaseSchema, CustomPatternComputeSchema, } from "./patternSchemas.js";
|
|
12
|
-
// ─── Application resource plan ───────────────────────────────────────────────
|
|
13
|
-
/**
|
|
14
|
-
* Application resource plan schema.
|
|
15
|
-
* Represents the complete plan for an application's infrastructure.
|
|
16
|
-
* Must be defined after ComputeResourcePlanSchema due to declaration order.
|
|
17
|
-
*/
|
|
18
|
-
export const ApplicationResourcePlanSchema = z
|
|
19
|
-
.object({
|
|
20
|
-
appName: AppNameSchema,
|
|
21
|
-
type: AppTypeSchema,
|
|
22
|
-
pattern: PatternSchema.optional(),
|
|
23
|
-
/** Pattern configuration for high-level infrastructure patterns (Payload, etc.) */
|
|
24
|
-
patternConfig: PatternConfigSchema.optional(),
|
|
25
|
-
owner: z.string().optional(),
|
|
26
|
-
tags: z.record(z.string(), z.string()).optional(),
|
|
27
|
-
vpcId: z.string().optional(),
|
|
28
|
-
network: NetworkResourcePlanSchema.optional(),
|
|
29
|
-
backup: BackupConfigSchema.optional(),
|
|
30
|
-
tunnel: TunnelConfigSchema.optional(),
|
|
31
|
-
additionalNetworks: z.array(AdditionalNetworkResourcePlanSchema).optional(),
|
|
32
|
-
database: z.array(DatabaseResourcePlanSchema),
|
|
33
|
-
s3: z.array(S3ResourcePlanSchema),
|
|
34
|
-
compute: z.array(ComputeResourcePlanSchema),
|
|
35
|
-
dynamodb: z.array(DynamoDBResourcePlanSchema).optional(),
|
|
36
|
-
sqs: z.array(SQSResourcePlanSchema).optional(),
|
|
37
|
-
cdn: CDNResourcePlanSchema.optional(),
|
|
38
|
-
/** Custom code blocks to preserve during regeneration */
|
|
39
|
-
customCodeBlocks: z.array(CustomCodeBlockSchema).optional(),
|
|
40
|
-
/** Additional managed imports to preserve during round-trip (non-standard imports from managed modules) */
|
|
41
|
-
additionalManagedImports: z
|
|
42
|
-
.array(z
|
|
43
|
-
.object({
|
|
44
|
-
moduleSpecifier: z.string(),
|
|
45
|
-
namedImports: z.array(z.string()),
|
|
46
|
-
defaultImport: z.string().optional(),
|
|
47
|
-
})
|
|
48
|
-
.strict())
|
|
49
|
-
.optional(),
|
|
50
|
-
})
|
|
51
|
-
.strict();
|
|
52
|
-
// ─── Application generator schema ────────────────────────────────────────────
|
|
53
|
-
export const ApplicationGeneratorSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
name: AppNameSchema,
|
|
56
|
-
type: AppTypeSchema,
|
|
57
|
-
pattern: PatternSchema.optional(),
|
|
58
|
-
/** Pattern tier: lightweight, standard, resilient, or custom */
|
|
59
|
-
patternTier: PatternTierSchema.optional(),
|
|
60
|
-
/** Custom domain for pattern (e.g., cms.example.com) */
|
|
61
|
-
patternDomain: z.string().optional(),
|
|
62
|
-
/** Custom database configuration (only used when patternTier is "custom") */
|
|
63
|
-
customDatabase: CustomPatternDatabaseSchema.optional(),
|
|
64
|
-
/** Custom compute configuration (only used when patternTier is "custom") */
|
|
65
|
-
customCompute: CustomPatternComputeSchema.optional(),
|
|
66
|
-
region: z.string().optional(),
|
|
67
|
-
owner: z.string().optional(),
|
|
68
|
-
includeDatabase: z.boolean().optional(),
|
|
69
|
-
databaseName: z
|
|
70
|
-
.string()
|
|
71
|
-
.min(1, VALIDATION_MESSAGES.DATABASE.NAME.REQUIRED)
|
|
72
|
-
.max(63, VALIDATION_MESSAGES.DATABASE.NAME.MAX_LENGTH)
|
|
73
|
-
.optional(),
|
|
74
|
-
vpcId: z.string().optional(),
|
|
75
|
-
network: NetworkConfigSchema.optional(),
|
|
76
|
-
services: z.array(ApplicationServiceConfigSchema).optional(),
|
|
77
|
-
snapshotIdentifier: z.string().optional(),
|
|
78
|
-
snapshotUsername: z.string().optional(),
|
|
79
|
-
})
|
|
80
|
-
.strict();
|
|
1
|
+
import{z as o}from"zod";import{VALIDATION_MESSAGES as a}from"../validation/patterns.js";import{AppNameSchema as t,AppTypeSchema as e,PatternSchema as r,CustomCodeBlockSchema as n,BackupConfigSchema as i,TunnelConfigSchema as p}from"./baseSchemas.js";import{DatabaseResourcePlanSchema as m}from"./databaseSchemas.js";import{NetworkResourcePlanSchema as c,AdditionalNetworkResourcePlanSchema as s,NetworkConfigSchema as l}from"./networkSchemas.js";import{S3ResourcePlanSchema as S}from"./storageSchemas.js";import{SQSResourcePlanSchema as u}from"./messagingSchemas.js";import{CDNResourcePlanSchema as h}from"./cdnSchemas.js";import{ComputeResourcePlanSchema as g,ApplicationServiceConfigSchema as d}from"./computeSchemas.js";import{DynamoDBResourcePlanSchema as f}from"./databaseSchemas.js";import{PatternConfigSchema as A,PatternTierSchema as y,CustomPatternDatabaseSchema as C,CustomPatternComputeSchema as P}from"./patternSchemas.js";const v=o.object({appName:t,type:e,pattern:r.optional(),patternConfig:A.optional(),owner:o.string().optional(),tags:o.record(o.string(),o.string()).optional(),vpcId:o.string().optional(),network:c.optional(),backup:i.optional(),tunnel:p.optional(),additionalNetworks:o.array(s).optional(),database:o.array(m),s3:o.array(S),compute:o.array(g),dynamodb:o.array(f).optional(),sqs:o.array(u).optional(),cdn:h.optional(),customCodeBlocks:o.array(n).optional(),additionalManagedImports:o.array(o.object({moduleSpecifier:o.string(),namedImports:o.array(o.string()),defaultImport:o.string().optional()}).strict()).optional()}).strict(),j=o.object({name:t,type:e,pattern:r.optional(),patternTier:y.optional(),patternDomain:o.string().optional(),customDatabase:C.optional(),customCompute:P.optional(),region:o.string().optional(),owner:o.string().optional(),includeDatabase:o.boolean().optional(),databaseName:o.string().min(1,a.DATABASE.NAME.REQUIRED).max(63,a.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:o.string().optional(),network:l.optional(),services:o.array(d).optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()}).strict();export{j as ApplicationGeneratorSchema,v as ApplicationResourcePlanSchema};
|