@reyemtech/nimbus 1.1.2 → 1.3.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/dist/cjs/azure/index.d.ts +1 -0
- package/dist/cjs/azure/index.d.ts.map +1 -1
- package/dist/cjs/azure/index.js +3 -1
- package/dist/cjs/azure/index.js.map +1 -1
- package/dist/cjs/azure/resource-group.d.ts +37 -0
- package/dist/cjs/azure/resource-group.d.ts.map +1 -0
- package/dist/cjs/azure/resource-group.js +79 -0
- package/dist/cjs/azure/resource-group.js.map +1 -0
- package/dist/cjs/azure/secrets.d.ts +6 -3
- package/dist/cjs/azure/secrets.d.ts.map +1 -1
- package/dist/cjs/azure/secrets.js +17 -3
- package/dist/cjs/azure/secrets.js.map +1 -1
- package/dist/cjs/cli/azure-prompts.d.ts +31 -0
- package/dist/cjs/cli/azure-prompts.d.ts.map +1 -0
- package/dist/cjs/cli/azure-prompts.js +49 -0
- package/dist/cjs/cli/azure-prompts.js.map +1 -0
- package/dist/cjs/cli/prompt.d.ts +34 -0
- package/dist/cjs/cli/prompt.d.ts.map +1 -0
- package/dist/cjs/cli/prompt.js +61 -0
- package/dist/cjs/cli/prompt.js.map +1 -0
- package/dist/cjs/cli/templates-azure.d.ts +34 -0
- package/dist/cjs/cli/templates-azure.d.ts.map +1 -0
- package/dist/cjs/cli/templates-azure.js +449 -0
- package/dist/cjs/cli/templates-azure.js.map +1 -0
- package/dist/cjs/cli/templates.d.ts +12 -22
- package/dist/cjs/cli/templates.d.ts.map +1 -1
- package/dist/cjs/cli/templates.js +11 -424
- package/dist/cjs/cli/templates.js.map +1 -1
- package/dist/cjs/cli.js +26 -4
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/factories/secrets.d.ts +1 -1
- package/dist/cjs/factories/secrets.js +3 -3
- package/dist/cjs/factories/secrets.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/azure/index.d.ts +1 -0
- package/dist/esm/azure/index.d.ts.map +1 -1
- package/dist/esm/azure/index.js +3 -1
- package/dist/esm/azure/index.js.map +1 -1
- package/dist/esm/azure/resource-group.d.ts +37 -0
- package/dist/esm/azure/resource-group.d.ts.map +1 -0
- package/dist/esm/azure/resource-group.js +79 -0
- package/dist/esm/azure/resource-group.js.map +1 -0
- package/dist/esm/azure/secrets.d.ts +6 -3
- package/dist/esm/azure/secrets.d.ts.map +1 -1
- package/dist/esm/azure/secrets.js +17 -3
- package/dist/esm/azure/secrets.js.map +1 -1
- package/dist/esm/cli/azure-prompts.d.ts +31 -0
- package/dist/esm/cli/azure-prompts.d.ts.map +1 -0
- package/dist/esm/cli/azure-prompts.js +49 -0
- package/dist/esm/cli/azure-prompts.js.map +1 -0
- package/dist/esm/cli/prompt.d.ts +34 -0
- package/dist/esm/cli/prompt.d.ts.map +1 -0
- package/dist/esm/cli/prompt.js +61 -0
- package/dist/esm/cli/prompt.js.map +1 -0
- package/dist/esm/cli/templates-azure.d.ts +34 -0
- package/dist/esm/cli/templates-azure.d.ts.map +1 -0
- package/dist/esm/cli/templates-azure.js +449 -0
- package/dist/esm/cli/templates-azure.js.map +1 -0
- package/dist/esm/cli/templates.d.ts +12 -22
- package/dist/esm/cli/templates.d.ts.map +1 -1
- package/dist/esm/cli/templates.js +11 -424
- package/dist/esm/cli/templates.js.map +1 -1
- package/dist/esm/cli.js +26 -4
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/factories/secrets.d.ts +1 -1
- package/dist/esm/factories/secrets.js +3 -3
- package/dist/esm/factories/secrets.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Azure project templates for `nimbus new`.
|
|
4
|
+
*
|
|
5
|
+
* Contains the minimal-azure, azure, and multi-cloud template generators,
|
|
6
|
+
* split from templates.ts to keep files under the 500-line limit.
|
|
7
|
+
*
|
|
8
|
+
* @module cli/templates-azure
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.minimalAzureTemplate = minimalAzureTemplate;
|
|
12
|
+
exports.azureTemplate = azureTemplate;
|
|
13
|
+
exports.multiCloudTemplate = multiCloudTemplate;
|
|
14
|
+
const templates_js_1 = require("./templates.js");
|
|
15
|
+
/** Default Azure region used when no options are provided. */
|
|
16
|
+
const DEFAULT_AZURE_REGION = "canadacentral";
|
|
17
|
+
/**
|
|
18
|
+
* Minimal Azure template — state backend + Key Vault, no cluster.
|
|
19
|
+
*
|
|
20
|
+
* @param name - Project name substituted into resource names
|
|
21
|
+
* @param options - Optional template options with Azure configuration
|
|
22
|
+
* @returns Template files
|
|
23
|
+
*/
|
|
24
|
+
function minimalAzureTemplate(name, options) {
|
|
25
|
+
const region = options?.azure?.region ?? DEFAULT_AZURE_REGION;
|
|
26
|
+
const resourceGroupName = options?.azure?.resourceGroupName ?? `rg-${name}-${region}`;
|
|
27
|
+
const indexTs = `/**
|
|
28
|
+
* ${name} — Minimal Azure infrastructure.
|
|
29
|
+
*
|
|
30
|
+
* Deploys: Azure Blob state backend + Key Vault
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* pulumi up
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
import { createStateBackend, createSecrets, ensureResourceGroup } from "@reyemtech/nimbus";
|
|
37
|
+
import type { IStateBackend, ISecrets } from "@reyemtech/nimbus";
|
|
38
|
+
|
|
39
|
+
const tags = { environment: "production" };
|
|
40
|
+
|
|
41
|
+
// Resource group is declared automatically — created if new, no-op if exists
|
|
42
|
+
const resourceGroupName = ensureResourceGroup("${resourceGroupName}", { tags });
|
|
43
|
+
|
|
44
|
+
const azureOptions = {
|
|
45
|
+
azure: {
|
|
46
|
+
resourceGroupName,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 1. State Backend — Azure Blob Storage with versioning and encryption
|
|
51
|
+
const backend = createStateBackend("${name}", {
|
|
52
|
+
cloud: "azure",
|
|
53
|
+
versioning: true,
|
|
54
|
+
encryption: true,
|
|
55
|
+
tags,
|
|
56
|
+
providerOptions: azureOptions,
|
|
57
|
+
}) as IStateBackend;
|
|
58
|
+
|
|
59
|
+
// 2. Secrets — Azure Key Vault (tenant ID auto-detected)
|
|
60
|
+
const secrets = createSecrets("${name}", {
|
|
61
|
+
cloud: "azure",
|
|
62
|
+
backend: "azure-key-vault",
|
|
63
|
+
tags,
|
|
64
|
+
providerOptions: azureOptions,
|
|
65
|
+
}) as ISecrets;
|
|
66
|
+
|
|
67
|
+
secrets.putSecret("database", {
|
|
68
|
+
host: "db.internal.example.com",
|
|
69
|
+
password: "change-me-in-pulumi-config",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Stack outputs
|
|
73
|
+
export const backendUrl = backend.backendUrl;
|
|
74
|
+
export const storageAccountName = backend.storageAccountName;
|
|
75
|
+
`;
|
|
76
|
+
const readmeMd = `# ${name}
|
|
77
|
+
|
|
78
|
+
Minimal Azure infrastructure — state backend + secrets, no cluster required.
|
|
79
|
+
|
|
80
|
+
## Components
|
|
81
|
+
|
|
82
|
+
- **State Backend** — Azure Blob Storage with versioning and encryption
|
|
83
|
+
- **Secrets** — Azure Key Vault for sensitive configuration
|
|
84
|
+
|
|
85
|
+
## Architecture
|
|
86
|
+
|
|
87
|
+
\`\`\`mermaid
|
|
88
|
+
graph LR
|
|
89
|
+
subgraph Azure["Azure"]
|
|
90
|
+
SA[Storage Account]
|
|
91
|
+
BC[Blob Container]
|
|
92
|
+
KV[Key Vault]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
SA --> BC
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
${templates_js_1.OPERATIONS_SECTION}
|
|
99
|
+
`;
|
|
100
|
+
return { indexTs, readmeMd };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Full Azure stack — VNet + AKS + Azure DNS + Key Vault + Platform.
|
|
104
|
+
*
|
|
105
|
+
* @param name - Project name substituted into resource names
|
|
106
|
+
* @param options - Optional template options with Azure configuration
|
|
107
|
+
* @returns Template files
|
|
108
|
+
*/
|
|
109
|
+
function azureTemplate(name, options) {
|
|
110
|
+
const region = options?.azure?.region ?? DEFAULT_AZURE_REGION;
|
|
111
|
+
const resourceGroupName = options?.azure?.resourceGroupName ?? `rg-${name}-${region}`;
|
|
112
|
+
const indexTs = `/**
|
|
113
|
+
* ${name} — Full Azure infrastructure stack.
|
|
114
|
+
*
|
|
115
|
+
* Deploys: VNet + AKS + Azure DNS + Key Vault + Platform Stack
|
|
116
|
+
*
|
|
117
|
+
* Usage:
|
|
118
|
+
* pulumi up
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
import {
|
|
122
|
+
createNetwork,
|
|
123
|
+
createCluster,
|
|
124
|
+
createDns,
|
|
125
|
+
createSecrets,
|
|
126
|
+
createPlatformStack,
|
|
127
|
+
ensureResourceGroup,
|
|
128
|
+
} from "@reyemtech/nimbus";
|
|
129
|
+
import type { INetwork, ICluster, IDns, ISecrets } from "@reyemtech/nimbus";
|
|
130
|
+
|
|
131
|
+
const tags = { environment: "production", client: "acme" };
|
|
132
|
+
|
|
133
|
+
// Resource group is declared automatically — created if new, no-op if exists
|
|
134
|
+
const resourceGroupName = ensureResourceGroup("${resourceGroupName}", { tags });
|
|
135
|
+
|
|
136
|
+
const azureOptions = {
|
|
137
|
+
azure: {
|
|
138
|
+
resourceGroupName,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// 1. Network — VNet with NAT Gateway
|
|
143
|
+
const network = createNetwork("${name}", {
|
|
144
|
+
cloud: "azure",
|
|
145
|
+
cidr: "10.1.0.0/16",
|
|
146
|
+
natStrategy: "managed",
|
|
147
|
+
tags,
|
|
148
|
+
providerOptions: azureOptions,
|
|
149
|
+
}) as INetwork;
|
|
150
|
+
|
|
151
|
+
// 2. Cluster — AKS with system + user node pools
|
|
152
|
+
const cluster = createCluster(
|
|
153
|
+
"${name}",
|
|
154
|
+
{
|
|
155
|
+
cloud: "azure",
|
|
156
|
+
version: "1.32",
|
|
157
|
+
nodePools: [
|
|
158
|
+
{
|
|
159
|
+
name: "system",
|
|
160
|
+
instanceType: "Standard_D2s_v5",
|
|
161
|
+
minNodes: 2,
|
|
162
|
+
maxNodes: 3,
|
|
163
|
+
mode: "system",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "workers",
|
|
167
|
+
instanceType: "Standard_D4s_v5",
|
|
168
|
+
minNodes: 1,
|
|
169
|
+
maxNodes: 10,
|
|
170
|
+
spot: true,
|
|
171
|
+
mode: "user",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
virtualNodes: true,
|
|
175
|
+
tags,
|
|
176
|
+
providerOptions: azureOptions,
|
|
177
|
+
},
|
|
178
|
+
network,
|
|
179
|
+
) as ICluster;
|
|
180
|
+
|
|
181
|
+
// 3. DNS — Azure DNS Zone
|
|
182
|
+
const dns = createDns("${name}", {
|
|
183
|
+
cloud: "azure",
|
|
184
|
+
zoneName: "example.com",
|
|
185
|
+
records: [
|
|
186
|
+
{ name: "app", type: "A", values: ["1.2.3.4"], ttl: 300 },
|
|
187
|
+
{ name: "www", type: "CNAME", values: ["app.example.com"], ttl: 300 },
|
|
188
|
+
],
|
|
189
|
+
providerOptions: azureOptions,
|
|
190
|
+
}) as IDns;
|
|
191
|
+
|
|
192
|
+
// 4. Secrets — Azure Key Vault (tenant ID auto-detected)
|
|
193
|
+
const secrets = createSecrets("${name}", {
|
|
194
|
+
cloud: "azure",
|
|
195
|
+
backend: "azure-key-vault",
|
|
196
|
+
tags,
|
|
197
|
+
providerOptions: azureOptions,
|
|
198
|
+
}) as ISecrets;
|
|
199
|
+
|
|
200
|
+
secrets.putSecret("database", {
|
|
201
|
+
host: "db.internal.example.com",
|
|
202
|
+
password: "change-me-in-pulumi-config",
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// 5. Platform — Helm components on the cluster
|
|
206
|
+
const platform = createPlatformStack("${name}", {
|
|
207
|
+
cluster,
|
|
208
|
+
domain: "example.com",
|
|
209
|
+
externalDns: {
|
|
210
|
+
dnsProvider: "azure-dns",
|
|
211
|
+
domainFilters: ["example.com"],
|
|
212
|
+
},
|
|
213
|
+
vault: { enabled: true, ingressHost: "vault.example.com" },
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Stack outputs
|
|
217
|
+
export const vnetId = network.vpcId;
|
|
218
|
+
export const clusterEndpoint = cluster.endpoint;
|
|
219
|
+
export const zoneId = dns.zoneId;
|
|
220
|
+
export const nameServers = dns.nameServers;
|
|
221
|
+
export const platformName = Array.isArray(platform) ? platform[0]?.name : platform.name;
|
|
222
|
+
`;
|
|
223
|
+
const readmeMd = `# ${name}
|
|
224
|
+
|
|
225
|
+
Full Azure infrastructure stack using the nimbus factory API.
|
|
226
|
+
|
|
227
|
+
## Components
|
|
228
|
+
|
|
229
|
+
- **Network** — VNet with NAT Gateway
|
|
230
|
+
- **Cluster** — AKS with system + spot user node pools and virtual nodes
|
|
231
|
+
- **DNS** — Azure DNS zone with A and CNAME records
|
|
232
|
+
- **Secrets** — Azure Key Vault for database credentials
|
|
233
|
+
- **Platform** — Traefik, cert-manager, External DNS, Vault via Helm
|
|
234
|
+
|
|
235
|
+
## Architecture
|
|
236
|
+
|
|
237
|
+
\`\`\`mermaid
|
|
238
|
+
graph LR
|
|
239
|
+
Internet((Internet))
|
|
240
|
+
|
|
241
|
+
subgraph Azure["Azure"]
|
|
242
|
+
ADNS[Azure DNS]
|
|
243
|
+
KV[Key Vault]
|
|
244
|
+
|
|
245
|
+
subgraph VNet["VNet 10.1.0.0/16"]
|
|
246
|
+
NAT[NAT Gateway]
|
|
247
|
+
|
|
248
|
+
subgraph AKS["AKS v1.32"]
|
|
249
|
+
SYS[System Pool]
|
|
250
|
+
WORK[Worker Pool spot]
|
|
251
|
+
|
|
252
|
+
subgraph Platform["Platform Stack"]
|
|
253
|
+
TRF[Traefik]
|
|
254
|
+
CM[cert-manager]
|
|
255
|
+
EDNS[External DNS]
|
|
256
|
+
VLT[Vault]
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
Internet --> TRF --> WORK
|
|
263
|
+
EDNS --> ADNS
|
|
264
|
+
VLT --> KV
|
|
265
|
+
VNet --> NAT --> Internet
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
${templates_js_1.OPERATIONS_SECTION}
|
|
269
|
+
`;
|
|
270
|
+
return { indexTs, readmeMd };
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Multi-cloud template — AWS + Azure active-active with GLB.
|
|
274
|
+
*
|
|
275
|
+
* @param name - Project name substituted into resource names
|
|
276
|
+
* @param options - Optional template options with Azure configuration
|
|
277
|
+
* @returns Template files
|
|
278
|
+
*/
|
|
279
|
+
function multiCloudTemplate(name, options) {
|
|
280
|
+
const region = options?.azure?.region ?? DEFAULT_AZURE_REGION;
|
|
281
|
+
const resourceGroupName = options?.azure?.resourceGroupName ?? `rg-${name}-${region}`;
|
|
282
|
+
const indexTs = `/**
|
|
283
|
+
* ${name} — Multi-cloud AWS + Azure active-active deployment.
|
|
284
|
+
*
|
|
285
|
+
* Deploys: Dual VPC/VNet + EKS/AKS + DNS + Platform + Global Load Balancer
|
|
286
|
+
*
|
|
287
|
+
* Usage:
|
|
288
|
+
* pulumi up
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
import {
|
|
292
|
+
createNetwork,
|
|
293
|
+
createCluster,
|
|
294
|
+
createDns,
|
|
295
|
+
createPlatformStack,
|
|
296
|
+
createGlobalLoadBalancer,
|
|
297
|
+
ensureResourceGroup,
|
|
298
|
+
} from "@reyemtech/nimbus";
|
|
299
|
+
import type { INetwork, ICluster, IDns } from "@reyemtech/nimbus";
|
|
300
|
+
|
|
301
|
+
// Resource group is declared automatically — created if new, no-op if exists
|
|
302
|
+
const resourceGroupName = ensureResourceGroup("${resourceGroupName}");
|
|
303
|
+
|
|
304
|
+
// Shared provider options
|
|
305
|
+
const providerOptions = {
|
|
306
|
+
aws: { autoMode: true },
|
|
307
|
+
azure: { resourceGroupName },
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
// 1. Networks — Auto-offset CIDRs: AWS gets 10.0.0.0/16, Azure gets 10.1.0.0/16
|
|
311
|
+
const networks = createNetwork("${name}", {
|
|
312
|
+
cloud: [
|
|
313
|
+
{ provider: "aws", region: "us-east-1" },
|
|
314
|
+
{ provider: "azure", region: "${region}" },
|
|
315
|
+
],
|
|
316
|
+
cidr: "10.0.0.0/16",
|
|
317
|
+
natStrategy: "fck-nat",
|
|
318
|
+
providerOptions,
|
|
319
|
+
}) as INetwork[];
|
|
320
|
+
|
|
321
|
+
// 2. Clusters — EKS + AKS, auto-matched to networks by provider
|
|
322
|
+
const clusters = createCluster(
|
|
323
|
+
"${name}",
|
|
324
|
+
{
|
|
325
|
+
cloud: [
|
|
326
|
+
{ provider: "aws", region: "us-east-1" },
|
|
327
|
+
{ provider: "azure", region: "${region}" },
|
|
328
|
+
],
|
|
329
|
+
version: "1.32",
|
|
330
|
+
nodePools: [
|
|
331
|
+
{ name: "system", instanceType: "t4g.small", minNodes: 2, maxNodes: 3 },
|
|
332
|
+
{
|
|
333
|
+
name: "workers",
|
|
334
|
+
instanceType: "c6a.large",
|
|
335
|
+
minNodes: 2,
|
|
336
|
+
maxNodes: 8,
|
|
337
|
+
spot: true,
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
providerOptions,
|
|
341
|
+
},
|
|
342
|
+
networks,
|
|
343
|
+
) as ICluster[];
|
|
344
|
+
|
|
345
|
+
// 3. DNS — Route 53 hosted zone
|
|
346
|
+
const dns = createDns("${name}", {
|
|
347
|
+
cloud: "aws",
|
|
348
|
+
zoneName: "example.com",
|
|
349
|
+
}) as IDns;
|
|
350
|
+
|
|
351
|
+
// 4. Platform — Deploy to both clusters
|
|
352
|
+
createPlatformStack("${name}", {
|
|
353
|
+
cluster: clusters,
|
|
354
|
+
domain: "example.com",
|
|
355
|
+
externalDns: {
|
|
356
|
+
dnsProvider: "route53",
|
|
357
|
+
domainFilters: ["example.com"],
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// 5. Global Load Balancer — Active-active across both clouds
|
|
362
|
+
const glb = createGlobalLoadBalancer("${name}", {
|
|
363
|
+
strategy: "active-active",
|
|
364
|
+
clusters,
|
|
365
|
+
domain: "app.example.com",
|
|
366
|
+
healthCheck: {
|
|
367
|
+
path: "/health",
|
|
368
|
+
port: 443,
|
|
369
|
+
protocol: "HTTPS",
|
|
370
|
+
intervalSeconds: 30,
|
|
371
|
+
unhealthyThreshold: 3,
|
|
372
|
+
},
|
|
373
|
+
dnsProvider: "route53",
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// Stack outputs
|
|
377
|
+
export const awsVpcId = networks[0]?.vpcId;
|
|
378
|
+
export const azureVnetId = networks[1]?.vpcId;
|
|
379
|
+
export const awsEndpoint = clusters[0]?.endpoint;
|
|
380
|
+
export const azureEndpoint = clusters[1]?.endpoint;
|
|
381
|
+
export const glbEndpoint = glb.endpoint;
|
|
382
|
+
export const glbStrategy = glb.strategy;
|
|
383
|
+
export const dnsZoneId = dns.zoneId;
|
|
384
|
+
`;
|
|
385
|
+
const readmeMd = `# ${name}
|
|
386
|
+
|
|
387
|
+
Multi-cloud AWS + Azure active-active deployment with Global Load Balancer.
|
|
388
|
+
|
|
389
|
+
## Components
|
|
390
|
+
|
|
391
|
+
- **Networks** — Auto-offset CIDRs (AWS: 10.0.0.0/16, Azure: 10.1.0.0/16)
|
|
392
|
+
- **Clusters** — EKS + AKS, same config, auto-matched to networks by provider
|
|
393
|
+
- **DNS** — Route 53 hosted zone
|
|
394
|
+
- **Platform** — Identical Helm stack deployed to both clusters
|
|
395
|
+
- **GLB** — Route 53 weighted routing with health checks across both clusters
|
|
396
|
+
|
|
397
|
+
## Architecture
|
|
398
|
+
|
|
399
|
+
\`\`\`mermaid
|
|
400
|
+
graph LR
|
|
401
|
+
Internet((Internet))
|
|
402
|
+
|
|
403
|
+
subgraph GLB["Global Load Balancer"]
|
|
404
|
+
R53GLB[Route 53 GLB]
|
|
405
|
+
HC1[Health Check AWS]
|
|
406
|
+
HC2[Health Check Azure]
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
subgraph AWS["AWS (us-east-1)"]
|
|
410
|
+
subgraph AWSVPC["VPC 10.0.0.0/16"]
|
|
411
|
+
subgraph AWSEKS["EKS v1.32"]
|
|
412
|
+
AWSTRF[Traefik]
|
|
413
|
+
AWSWORK[Workers spot]
|
|
414
|
+
AWSEDNS[External DNS]
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
subgraph AZ["Azure (${region})"]
|
|
420
|
+
subgraph AZVN["VNet 10.1.0.0/16"]
|
|
421
|
+
subgraph AZAKS["AKS v1.32"]
|
|
422
|
+
AZTRF[Traefik]
|
|
423
|
+
AZWORK[Workers spot]
|
|
424
|
+
AZEDNS[External DNS]
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
DNS[Route 53 DNS]
|
|
430
|
+
|
|
431
|
+
Internet --> R53GLB
|
|
432
|
+
R53GLB --> HC1 --> AWSTRF --> AWSWORK
|
|
433
|
+
R53GLB --> HC2 --> AZTRF --> AZWORK
|
|
434
|
+
AWSEDNS --> DNS
|
|
435
|
+
AZEDNS --> DNS
|
|
436
|
+
\`\`\`
|
|
437
|
+
|
|
438
|
+
## How It Works
|
|
439
|
+
|
|
440
|
+
1. **Factory dispatch** — \`createNetwork("${name}", { cloud: ["aws", "azure"] })\` creates both VPC and VNet
|
|
441
|
+
2. **CIDR auto-offset** — Second cloud auto-increments to \`10.1.0.0/16\` to avoid overlaps
|
|
442
|
+
3. **Provider matching** — \`createCluster(...)\` matches each cluster to its network by provider
|
|
443
|
+
4. **GLB** — Route 53 weighted records distribute traffic 50/50, health checks failover automatically
|
|
444
|
+
|
|
445
|
+
${templates_js_1.OPERATIONS_SECTION}
|
|
446
|
+
`;
|
|
447
|
+
return { indexTs, readmeMd };
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=templates-azure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates-azure.js","sourceRoot":"","sources":["../../../src/cli/templates-azure.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAeH,oDAgFC;AASD,sCAqKC;AASD,gDA4KC;AAhcD,iDAAoD;AAGpD,8DAA8D;AAC9D,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAE7C;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,IAAY,EAAE,OAA0B;IAC3E,MAAM,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,oBAAoB,CAAC;IAC9D,MAAM,iBAAiB,GAAG,OAAO,EAAE,KAAK,EAAE,iBAAiB,IAAI,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;IAEtF,MAAM,OAAO,GAAG;KACb,IAAI;;;;;;;;;;;;;;iDAcwC,iBAAiB;;;;;;;;;sCAS5B,IAAI;;;;;;;;;iCAST,IAAI;;;;;;;;;;;;;;;CAepC,CAAC;IAEA,MAAM,QAAQ,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;EAsB1B,iCAAkB;CACnB,CAAC;IAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,IAAY,EAAE,OAA0B;IACpE,MAAM,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,oBAAoB,CAAC;IAC9D,MAAM,iBAAiB,GAAG,OAAO,EAAE,KAAK,EAAE,iBAAiB,IAAI,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;IAEtF,MAAM,OAAO,GAAG;KACb,IAAI;;;;;;;;;;;;;;;;;;;;;iDAqBwC,iBAAiB;;;;;;;;;iCASjC,IAAI;;;;;;;;;;KAUhC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA6BgB,IAAI;;;;;;;;;;;iCAWI,IAAI;;;;;;;;;;;;;wCAaG,IAAI;;;;;;;;;;;;;;;;CAgB3C,CAAC;IAEA,MAAM,QAAQ,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6C1B,iCAAkB;CACnB,CAAC;IAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,IAAY,EAAE,OAA0B;IACzE,MAAM,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,oBAAoB,CAAC;IAC9D,MAAM,iBAAiB,GAAG,OAAO,EAAE,KAAK,EAAE,iBAAiB,IAAI,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;IAEtF,MAAM,OAAO,GAAG;KACb,IAAI;;;;;;;;;;;;;;;;;;;iDAmBwC,iBAAiB;;;;;;;;;kCAShC,IAAI;;;oCAGF,MAAM;;;;;;;;;KASrC,IAAI;;;;sCAI6B,MAAM;;;;;;;;;;;;;;;;;;;yBAmBnB,IAAI;;;;;;uBAMN,IAAI;;;;;;;;;;wCAUa,IAAI;;;;;;;;;;;;;;;;;;;;;;CAsB3C,CAAC;IAEA,MAAM,QAAQ,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkCJ,MAAM;;;;;;;;;;;;;;;;;;;;;6CAqBe,IAAI;;;;;EAK/C,iCAAkB;CACnB,CAAC;IAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Each template function returns the contents for `index.ts` and `README.md`
|
|
5
5
|
* with the project name substituted into resource names.
|
|
6
6
|
*
|
|
7
|
+
* Azure templates are in `templates-azure.ts` (split to stay under 500 lines).
|
|
8
|
+
*
|
|
7
9
|
* @module cli/templates
|
|
8
10
|
*/
|
|
9
11
|
/** Shape returned by every template function. */
|
|
@@ -11,11 +13,18 @@ export interface ITemplateFiles {
|
|
|
11
13
|
readonly indexTs: string;
|
|
12
14
|
readonly readmeMd: string;
|
|
13
15
|
}
|
|
16
|
+
/** Optional configuration passed to template generators. */
|
|
17
|
+
export interface ITemplateOptions {
|
|
18
|
+
readonly azure?: {
|
|
19
|
+
readonly region: string;
|
|
20
|
+
readonly resourceGroupName: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
14
23
|
/** Template metadata including provider dependencies. */
|
|
15
24
|
export interface ITemplateInfo {
|
|
16
25
|
readonly description: string;
|
|
17
26
|
readonly providers: ReadonlyArray<string>;
|
|
18
|
-
readonly generate: (name: string) => ITemplateFiles;
|
|
27
|
+
readonly generate: (name: string, options?: ITemplateOptions) => ITemplateFiles;
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
30
|
* Generate a Pulumi.yaml project file.
|
|
@@ -36,6 +45,8 @@ export declare const PROJECT_TSCONFIG: string;
|
|
|
36
45
|
/** Valid template names accepted by the CLI. */
|
|
37
46
|
export declare const TEMPLATE_NAMES: readonly ["empty", "minimal-aws", "minimal-azure", "aws", "azure", "multi-cloud"];
|
|
38
47
|
export type TemplateName = (typeof TEMPLATE_NAMES)[number];
|
|
48
|
+
/** Common operations section included in every generated README. */
|
|
49
|
+
export declare const OPERATIONS_SECTION = "## Operations\n\n```bash\npulumi preview # Preview changes before deploying\npulumi up # Deploy infrastructure\npulumi refresh # Sync state with actual cloud resources\npulumi destroy # Tear down all resources\npulumi config set <key> <value> # Set stack configuration (e.g. secrets)\npulumi stack output # View stack outputs\npulumi logs # View cloud resource logs (if supported)\n```\n";
|
|
39
50
|
/** Template registry with metadata and provider dependencies. */
|
|
40
51
|
export declare const TEMPLATES: Readonly<Record<TemplateName, ITemplateInfo>>;
|
|
41
52
|
/**
|
|
@@ -52,13 +63,6 @@ export declare function emptyTemplate(name: string): ITemplateFiles;
|
|
|
52
63
|
* @returns Template files
|
|
53
64
|
*/
|
|
54
65
|
export declare function minimalAwsTemplate(name: string): ITemplateFiles;
|
|
55
|
-
/**
|
|
56
|
-
* Minimal Azure template — state backend + Key Vault, no cluster.
|
|
57
|
-
*
|
|
58
|
-
* @param name - Project name substituted into resource names
|
|
59
|
-
* @returns Template files
|
|
60
|
-
*/
|
|
61
|
-
export declare function minimalAzureTemplate(name: string): ITemplateFiles;
|
|
62
66
|
/**
|
|
63
67
|
* Full AWS stack — VPC + EKS + Route 53 + Secrets + Platform.
|
|
64
68
|
*
|
|
@@ -66,18 +70,4 @@ export declare function minimalAzureTemplate(name: string): ITemplateFiles;
|
|
|
66
70
|
* @returns Template files
|
|
67
71
|
*/
|
|
68
72
|
export declare function awsTemplate(name: string): ITemplateFiles;
|
|
69
|
-
/**
|
|
70
|
-
* Full Azure stack — VNet + AKS + Azure DNS + Key Vault + Platform.
|
|
71
|
-
*
|
|
72
|
-
* @param name - Project name substituted into resource names
|
|
73
|
-
* @returns Template files
|
|
74
|
-
*/
|
|
75
|
-
export declare function azureTemplate(name: string): ITemplateFiles;
|
|
76
|
-
/**
|
|
77
|
-
* Multi-cloud template — AWS + Azure active-active with GLB.
|
|
78
|
-
*
|
|
79
|
-
* @param name - Project name substituted into resource names
|
|
80
|
-
* @returns Template files
|
|
81
|
-
*/
|
|
82
|
-
export declare function multiCloudTemplate(name: string): ITemplateFiles;
|
|
83
73
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/cli/templates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/cli/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;KACpC,CAAC;CACH;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,cAAc,CAAC;CACjF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAaxD;AAED,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,QAiB5B,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,cAAc,mFAOjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,+fAW9B,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CA+BnE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CA4C1D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAiE/D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CA8IxD"}
|