-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstages.sample.ts
97 lines (90 loc) · 2.39 KB
/
stages.sample.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
import { Cpu, Memory } from '@aws-cdk/aws-apprunner-alpha';
import { Duration } from 'aws-cdk-lib';
import { DomainAppsConfig, ProtoConfigOptions, RedCapConfig } from './prototyping';
const baseOptions: ProtoConfigOptions = {
name: 'REDCap',
profile: 'your_aws_profile',
region: 'ap-northeast-1',
allowedIps: ['192.0.3.0/24'],
allowedCountries: ['JP'], //(ISO) 3166
};
const dev: RedCapConfig = {
...baseOptions,
hostInRoute53: false,
phpTimezone: 'Asia/Tokyo',
redCapS3Path: 'redcap-binaries/redcap13.7.2.zip',
cronSecret: 'mysecret',
email: 'email@mydomain.com',
port: 8080,
dbReaders: 0, // disable readers for dev envs
// Uncomment to use ECS as backend instead of appRunner
// ecs: {
// memory: '4 GB',
// cpu: '4 vCPU',
// scaling: {
// maxContainers: 3,
// minContainers: 1,
// requestsPerContainer: 100,
// cpuUtilization: 90,
// },
// },
};
const prod: RedCapConfig = {
...baseOptions,
phpTimezone: 'Asia/Tokyo',
redCapLocalVersion: 'redcap13.7.2',
domain: 'redcap.mydomain.com',
hostInRoute53: true,
email: 'email@mydomain.com',
appRunnerConcurrency: 10,
appRunnerMaxSize: 10,
appRunnerMinSize: 2,
cronSecret: 'prodsecret',
cpu: Cpu.FOUR_VCPU,
memory: Memory.EIGHT_GB,
ec2ServerStack: {
ec2StackDuration: Duration.hours(3),
},
bounceNotificationEmail: 'email+bounce@mydomain.com',
};
const stag: RedCapConfig = {
...baseOptions,
redCapS3Path: 'redcap-binaries/redcap13.7.2.zip',
domain: 'redcap.mydomain.com',
phpTimezone: 'Asia/Tokyo',
hostInRoute53: true,
appRunnerConcurrency: 10,
appRunnerMaxSize: 5,
appRunnerMinSize: 1,
rebuildImage: false,
cronSecret: 'stagsecret',
cpu: Cpu.FOUR_VCPU,
memory: Memory.EIGHT_GB,
};
// Optional: External NameServer configuration with AppRunner stage, example:
// const route53NS: DomainAppsConfig = {
// ...baseOptions,
// profile: 'your_aws_profile',
// region: 'your_aws_region',
// domain: 'redcap.mydomain.com',
// apps: [
// {
// name: 'redcap',
// nsRecords: [
// 'ns-sample.co.uk',
// 'ns-sample.net',
// 'ns-sample.org',
// 'ns-sample.com',
// ],
// },
// ],
// };
// Default route53NS config, no records are created.
const route53NS: DomainAppsConfig = {
...baseOptions,
profile: 'your_aws_profile',
region: 'ap-northeast-1',
domain: '',
apps: [],
};
export { dev, prod, route53NS, stag };