-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.ts
84 lines (74 loc) · 2.32 KB
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { InstanceType } from "aws-cdk-lib/aws-ec2";
import { KubernetesVersion } from "aws-cdk-lib/aws-eks";
import { PostgresEngineVersion } from "aws-cdk-lib/aws-rds";
import { DESTROY_WHEN_REMOVE, EC2_INSTANCE_MAP, RDS_INSTANCE_MAP, REDIS_NODE_MAP } from "./constants";
import { StackConfig } from "./stackConfig";
/**
* Configuration for the test stack
*/
export interface TestStackConfig extends StackConfig {
}
export const testConfig: TestStackConfig = {
environment: 'Test',
region: process.env.CDK_TESTING_REGION || process.env.CDK_DEFAULT_REGION || '',
account: process.env.CDK_TESTING_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT || '',
cluster: {
version: KubernetesVersion.V1_29,
tags: { "marketplace": "dify" },
// at least 2 ids
vpcSubnetIds: process.env.EKS_CLUSTER_SUBNETS?.trim().split(',').filter(id => id.length > 0) || [],
managedNodeGroups: {
app: {
desiredSize: 1,
minSize: 1,
maxSize: 1,
instanceType: new InstanceType(EC2_INSTANCE_MAP['4c16m']),
diskSize: 100,
// at least 2 ids
workerNodeSubnetIds: process.env.EKS_NODES_SUBNETS?.trim().split(',').filter(id => id.length > 0) || [],
}
},
},
s3: {
removeWhenDestroyed: DESTROY_WHEN_REMOVE || false,
},
postgresSQL: {
version: PostgresEngineVersion.VER_14_9,
instanceType: new InstanceType(RDS_INSTANCE_MAP['2c8m']),
dbName: 'postgres',
dbCredentialUsername: 'clusteradmin',
backupRetention: 0,
storageSize: 256,
removeWhenDestroyed: true,
// at least 2 ids
subnetIds: process.env.RDS_SUBNETS?.trim().split(',').filter(id => id.length > 0) || [],
multiAz: {
enabled: false,
subnetGroupName: ''
}
},
redis: {
engineVersion: "6.2",
parameterGroup: "default.redis6.x",
nodeType: REDIS_NODE_MAP['6.38m'],
readReplicas: 1,
subnetIds: process.env.REDIS_SUBNETS?.trim().split(',').filter(id => id.length > 0) || [],
multiAZ: {
enabled: false,
subnetGroupName: ''
}
},
openSearch: {
enabled: true,
multiAz: {
enabled: false,
azCount: 2
},
subnetIds: process.env.OPENSEARCH_SUBNETS?.trim().split(',').filter(id => id.length > 0) || [],
capacity: {
dataNodes: 2,
dataNodeInstanceType: 'r6g.large.search',
},
dataNodeSize: 100
}
}