-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstacktape.yml
More file actions
96 lines (86 loc) · 2.25 KB
/
stacktape.yml
File metadata and controls
96 lines (86 loc) · 2.25 KB
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
serviceName: posts-app
scripts:
buildFrontend:
type: local-script
properties:
executeCommand: $Format('yarn client:build --mode {}', $Stage())
generatePrismaClient:
type: local-script
properties:
executeCommand: npx prisma generate
migrateDb:
type: local-script-with-bastion-tunneling
properties:
executeCommand: npx prisma db push --skip-generate --accept-data-loss
bastionResource: bastion
connectTo:
- mainDatabase
directives:
- name: getDomain
filePath: directives.ts:getDomain
variables:
domain: $getDomain($Stage())
hooks:
beforeDeploy:
- scriptName: buildFrontend
- scriptName: generatePrismaClient
afterDeploy:
- scriptName: migrateDb
resources:
bastion:
type: bastion
mainUserPool:
type: user-auth-pool
properties:
userVerificationType: email-code
passwordPolicy:
minimumLength: 8
callbackURLs:
- $Format('https://{}/', $Var().domain)
mainFirewall:
type: web-app-firewall
properties:
scope: cdn
webService:
type: web-service
properties:
packaging:
type: stacktape-image-buildpack
properties:
entryfilePath: ./server/index.ts
resources:
cpu: 0.25
memory: 512
connectTo:
- mainDatabase
- mainUserPool
cors:
enabled: true
mainDatabase:
type: relational-database
properties:
credentials:
masterUserName: $Secret('postgres-credentials.userName')
masterUserPassword: $Secret('postgres-credentials.password')
accessibility:
accessibilityMode: vpc
engine:
type: postgres
properties:
primaryInstance:
instanceSize: db.t4g.micro
webBucket:
type: hosting-bucket
properties:
uploadDirectoryPath: ./dist
hostingContentType: single-page-app
useFirewall: mainFirewall
injectEnvironment:
- name: VITE_USERPOOL_ID
value: $ResourceParam('mainUserPool', 'id')
- name: VITE_USERPOOL_CLIENT_ID
value: $ResourceParam('mainUserPool', 'clientId')
- name: VITE_API_URL
value: $ResourceParam('webService', 'url')
customDomains:
- domainName: $getDomain($Stage())