|
18 | 18 | import * as cdk from 'aws-cdk-lib';
|
19 | 19 | import { AmiHardwareType } from 'aws-cdk-lib/aws-ecs';
|
20 | 20 | import { z } from 'zod';
|
21 |
| -import { SecurityGroupConfigSchema } from '../../../lib/schema'; |
| 21 | +import path from 'path'; |
| 22 | +import fs from 'fs'; |
22 | 23 |
|
23 |
| -const VERSION: string = '2.0.1'; |
| 24 | +const HERE: string = path.resolve(__dirname); |
| 25 | +const VERSION_PATH: string = path.resolve(HERE, '..', 'VERSION'); |
| 26 | +export const VERSION: string = fs.readFileSync(VERSION_PATH, 'utf8').trim(); |
24 | 27 |
|
25 | 28 | const REMOVAL_POLICIES: Record<string, cdk.RemovalPolicy> = {
|
26 | 29 | destroy: cdk.RemovalPolicy.DESTROY,
|
@@ -538,6 +541,27 @@ const PypiConfigSchema = z.object({
|
538 | 541 | trustedHost: z.string().optional().default(''),
|
539 | 542 | });
|
540 | 543 |
|
| 544 | +/** |
| 545 | + * Configuration schema for Security Group imports. |
| 546 | + * These values are none/small/all, meaning a user can import any number of these or none of these. |
| 547 | + * |
| 548 | + * @property {string} modelSecurityGroupId - Security Group ID. |
| 549 | + * @property {string} restAlbSecurityGroupId - Security Group ID |
| 550 | + * @property {string} lambdaSecurityGroupId - Security Group ID |
| 551 | + * @property {string} liteLlmDbSecurityGroupId - Security Group ID. |
| 552 | + * @property {string} openSearchSecurityGroupId - Security Group ID. |
| 553 | + * @property {string} pgVectorSecurityGroupId - Security Group ID. |
| 554 | + */ |
| 555 | +export const SecurityGroupConfigSchema = z.object({ |
| 556 | + modelSecurityGroupId: z.string().startsWith('sg-'), |
| 557 | + restAlbSecurityGroupId: z.string().startsWith('sg-'), |
| 558 | + lambdaSecurityGroupId: z.string().startsWith('sg-'), |
| 559 | + liteLlmDbSecurityGroupId: z.string().startsWith('sg-'), |
| 560 | + openSearchSecurityGroupId: z.string().startsWith('sg-').optional(), |
| 561 | + pgVectorSecurityGroupId: z.string().startsWith('sg-').optional(), |
| 562 | +}) |
| 563 | + .describe('Security Group Overrides used across stacks.'); |
| 564 | + |
541 | 565 | /**
|
542 | 566 | * Raw application configuration schema.
|
543 | 567 | *
|
|
0 commit comments