forked from sst/demo-ai-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
41 lines (36 loc) · 989 Bytes
/
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
/// <reference path="./.sst/src/global.d.ts" />
export default $config({
app(input) {
return {
name: "movies",
removalPolicy: input?.stage === "production" ? "retain" : "remove",
providers: {
aws: {
profile: input?.stage === "production" ? "sst-production" : undefined,
},
},
};
},
async run() {
const db = new aws.dynamodb.Table("Movies", {
hashKey: "id",
billingMode: "PAY_PER_REQUEST",
attributes: [{ name: "id", type: "S" }],
});
const bucket = new sst.Bucket("Assets", {
public: true,
});
const vector = new sst.Vector("Vector", {
model: "text-embedding-ada-002",
openAiApiKey: new sst.Secret("OpenAiApiKey").value,
});
const site = new sst.Nextjs("Web", {
link: [db, bucket, vector],
domain: $app.stage === "production" ? "movies.sst.dev" : undefined,
});
return {
Table: db.name,
Bucket: bucket.name,
};
},
});