-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsst.config.ts
61 lines (54 loc) · 1.24 KB
/
sst.config.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
import { type SSTConfig } from 'sst';
import { existsSync } from 'fs';
// If a .env file exists throw an error
if (existsSync('.env')) {
throw new Error(
'Please rename .env to .env.local, this is because .env is always deployed to Staging and Production and we want to avoid this'
);
}
const awsRegionCodes = [
'us-east-1',
'us-east-2',
'us-west-1',
'us-west-2',
'af-south-1',
'ap-east-1',
'ap-south-1',
'ap-northeast-2',
'ap-southeast-1',
'ap-southeast-2',
'ap-northeast-1',
'ca-central-1',
'eu-central-1',
'eu-west-1',
'eu-west-2',
'eu-south-1',
'eu-west-3',
'eu-north-1',
'me-south-1',
'sa-east-1',
] as const;
type AwsRegionCode = (typeof awsRegionCodes)[number];
const config: SSTConfig = {
config(input) {
if (
input.stage !== undefined &&
input.stage !== 'dev' &&
input.stage !== 'staging' &&
input.stage !== 'production'
) {
throw new Error(`Invalid stage ${input.stage}`);
}
const stage = input.stage ?? 'dev';
return {
name: 'timesheeter-aws',
region: 'eu-west-2' as AwsRegionCode,
stage,
};
},
async stacks(app) {
const appStacks = await import('./stacks');
appStacks.default(app);
},
};
export default config;