-
Notifications
You must be signed in to change notification settings - Fork 11
/
app.1.js
48 lines (36 loc) · 1009 Bytes
/
app.1.js
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
const cdk = require('@aws-cdk/cdk');
const ecs = require('@aws-cdk/aws-ecs');
const ec2 = require('@aws-cdk/aws-ec2');
class BaseResources extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);
// Network to run everything in
this.vpc = new ec2.VpcNetwork(this, 'vpc', {
maxAZs: 2,
natGateways: 1
});
// Cluster all the containers will run in
this.cluster = new ecs.Cluster(this, 'cluster', { vpc: this.vpc });
}
}
class API extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);
// Deploy an API component
}
}
class Worker extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);
// Deploy a worker component
}
}
class App extends cdk.App {
constructor(argv) {
super(argv);
this.baseResources = new BaseResources(this, 'base-resources');
this.api = new API(this, 'api', {});
this.worker = new Worker(this, 'worker', {});
}
}
new App().run();