-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathframework.ts
53 lines (44 loc) · 1.71 KB
/
framework.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
/*
These classes don't do anything amazing. Yet!
The plan is to sprinkle some framework specific tooling into them.
For example, a Play app should come with the infrastructure for https://github.com/guardian/play-secret-rotation.
*/
import { AccessScope } from "../../constants";
import type { GuStack } from "../../constructs/core";
import type { GuDomainName } from "../../types";
import type { GuEc2AppProps } from "./base";
import { GuEc2App } from "./base";
type GuEc2FrameworkAppProps = Omit<GuEc2AppProps, "applicationPort"> & { certificateProps: GuDomainName };
type GuEc2WorkerProps = Omit<GuEc2AppProps, "applicationPort" | "access">;
/**
* Creates an instance of [[`GuEc2App`]], with an application port of 9000 and no access to the load balancer.
* This is useful for applications that only have an LB for health check purposes
*/
export class GuPlayWorkerApp extends GuEc2App {
static readonly PORT: number = 9000;
constructor(scope: GuStack, props: GuEc2WorkerProps) {
super(scope, {
...props,
applicationPort: GuPlayWorkerApp.PORT,
access: { scope: AccessScope.INTERNAL, cidrRanges: [] },
});
}
}
/**
* Creates an instance of [[`GuEc2App`]], with an application port of 9000.
*/
export class GuPlayApp extends GuEc2App {
static readonly PORT: number = 9000;
constructor(scope: GuStack, props: GuEc2FrameworkAppProps) {
super(scope, { ...props, applicationPort: GuPlayApp.PORT });
}
}
/**
* Creates an instance of [[`GuEc2App`]], with an application port of 3000.
*/
export class GuNodeApp extends GuEc2App {
static readonly PORT: number = 3000;
constructor(scope: GuStack, props: GuEc2FrameworkAppProps) {
super(scope, { ...props, applicationPort: GuNodeApp.PORT });
}
}