-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
114 lines (95 loc) · 3.4 KB
/
app.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env node
import { App } from 'aws-cdk-lib';
// import { CacheRepoStack, CachePipeline, CacheEcrStack, CacheEcsStack } from './cache-server';
import { BuildBotConfig, BuildBotImageRepo, BuildBotPipeline, BuildBotServer, BuildBotFilesystem } from './buildbot';
import { DeveloperStages, FederateOIDC } from './constants';
import { Vpc, Cluster, ServiceDomain } from './stacks';
// Set up your CDK App
const app = new App();
const dev = true;
if (dev) {
const devName = process.env.USER || '';
const stageProps = DeveloperStages[devName];
const env = { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION };
const terminationProtection = false;
/// App stacks
const vpc = new Vpc(app, 'Vpc', {
env,
terminationProtection,
});
const cluster = new Cluster(app, 'Cluster', {
vpc: vpc.vpc,
env,
terminationProtection,
});
const serviceDomain = new ServiceDomain(app, 'ServiceNamespace', {
vpc: vpc.vpc,
env,
terminationProtection,
});
// const ssr = new CacheRepoStack(app, 'CacheRepo-Personal', {
// env,
// terminationProtection,
// });
// const ecr = new CacheEcrStack(app, 'CacheEcr-Personal', {
// env,
// terminationProtection,
// });
// const ecs = new CacheEcsStack(app, 'CacheEcs-Personal', {
// env,
// terminationProtection,
// repository: ecr.repo,
// cluster: cluster.cluster,
// vpc: vpc.vpc,
// namespace: serviceDomain.namespace,
// });
const buildBotConfig = new BuildBotConfig(app, 'BuildBotConfig-Personal', {
env,
terminationProtection,
});
const buildBotImageRepo = new BuildBotImageRepo(app, 'BuildBotImageRepo-Personal', {
env,
terminationProtection,
});
const buildBotFilesystem = new BuildBotFilesystem(app, 'BuildBotFilesystem-Personal', {
env,
terminationProtection,
vpc: vpc.vpc,
});
const buildBotServer = new BuildBotServer(app, 'BuildBotServer-Personal', {
env,
terminationProtection,
vpc: vpc.vpc,
cluster: cluster.cluster,
serviceName: 'buildbot',
imageRepository: buildBotImageRepo.repo,
keypair: 'buildbot-key',
filesystem: buildBotFilesystem.filesystem,
accesspoint: buildBotFilesystem.accesspoint,
useWebhookAPI: true,
namespace: serviceDomain.namespace,
oidcAction: FederateOIDC,
});
new BuildBotPipeline(app, 'BuildBotPipeline-Personal', {
env,
terminationProtection,
bucket: buildBotConfig.bucket,
bucketKey: 'admin-config/config.zip',
service: buildBotServer.service,
repo: buildBotImageRepo.repo,
configrepo: buildBotConfig.configrepo,
workersg: buildBotServer.workerSecurityGroup.securityGroupId,
workerVpcSubnetID: buildBotServer.workerVpcSubnetID,
loadBalancerDNS: buildBotServer.loadBalancerDNS,
buildBotServerPrivateDNS: buildBotServer.buildBotServerPrivateDNS,
workerSstateEfsFsID: buildBotServer.sstateFS.fileSystemId,
});
// new CachePipeline(app, 'CachePipeline-Personal', {
// env,
// terminationProtection,
// repository: ecr.repo,
// cacheRepo: ssr.repo.repositoryName,
// ecsCacheFargateService: ecs.service,
// });
}
// End