generated from vercel/ai-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
65 lines (60 loc) · 1.53 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
62
63
64
65
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "ai-chatbot-aws",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage),
home: "aws",
providers: {
aws: {
profile:
input.stage === "production" ? "serg-production" : "serg-dev",
},
},
};
},
async run() {
// Secrets for AWS Bedrock
const bedrockAccessKeyId = new sst.Secret(
"BedrockAccessKeyId",
"placeholder"
);
const bedrockSecretAccessKey = new sst.Secret(
"BedrockSecretAccessKey",
"placeholder"
);
const authSecret = new sst.Secret("AuthSecret", "placeholder");
const vpc = new sst.aws.Vpc("AIChatbotAWSVPC", {
bastion: true,
nat: "ec2",
});
const database = new sst.aws.Postgres("AIChatbotAWSDB", { vpc });
const bucket = new sst.aws.Bucket("AIChatbotAWSBucket", {
access: "public",
});
new sst.aws.Nextjs("AIChatbotAWS", {
environment: {
NEXTAUTH_URL: "https://aws-chat-app.serg.tech",
},
domain: {
name: "aws-chat-app.serg.tech",
dns: sst.cloudflare.dns(),
},
vpc,
link: [
database,
bedrockAccessKeyId,
bedrockSecretAccessKey,
authSecret,
bucket,
],
});
new sst.x.DevCommand("AIChatbotAWSStudio", {
link: [database],
dev: {
command: "npx drizzle-kit studio",
},
});
},
});