mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
⭐feat(infra): Use a shared VPC (#218)
## Description The scope of this PR is to add a shared VPC for everyone on the team.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { vpc } from "./vpc";
|
||||
import { bus } from "./bus";
|
||||
import { domain } from "./dns";
|
||||
import { email } from "./email";
|
||||
// import { email } from "./email";
|
||||
import { secret } from "./secret";
|
||||
import { postgres } from "./postgres";
|
||||
|
||||
@@ -19,7 +19,7 @@ export const auth = new sst.aws.Auth("Auth", {
|
||||
handler: "packages/functions/src/auth.handler",
|
||||
link: [
|
||||
bus,
|
||||
email,
|
||||
// email,
|
||||
postgres,
|
||||
authFingerprintKey,
|
||||
secret.PolarSecret,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { vpc } from "./vpc";
|
||||
import { email } from "./email";
|
||||
// import { email } from "./email";
|
||||
import { allSecrets } from "./secret";
|
||||
import { postgres } from "./postgres";
|
||||
|
||||
@@ -9,7 +9,7 @@ bus.subscribe("Event", {
|
||||
vpc,
|
||||
handler: "./packages/functions/src/event/event.handler",
|
||||
link: [
|
||||
email,
|
||||
// email,
|
||||
postgres,
|
||||
...allSecrets
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { domain } from "./dns";
|
||||
|
||||
export const email = new sst.aws.Email("Mail",{
|
||||
sender: domain,
|
||||
dns: sst.cloudflare.dns(),
|
||||
})
|
||||
// export const email = new sst.aws.Email("Mail",{
|
||||
// sender: domain,
|
||||
// dns: sst.cloudflare.dns(),
|
||||
// })
|
||||
@@ -2,7 +2,7 @@ import { vpc } from "./vpc";
|
||||
import { isPermanentStage } from "./stage";
|
||||
|
||||
// TODO: Add a dev db to use, this will help with running zero locally... and testing it
|
||||
export const postgres = new sst.aws.Aurora("Postgres", {
|
||||
export const postgres = new sst.aws.Aurora("Database", {
|
||||
vpc,
|
||||
engine: "postgres",
|
||||
scaling: isPermanentStage
|
||||
|
||||
26
infra/vpc.ts
26
infra/vpc.ts
@@ -1,17 +1,11 @@
|
||||
// import { isPermanentStage } from "./stage";
|
||||
import { isPermanentStage } from "./stage";
|
||||
|
||||
// export const vpc = isPermanentStage
|
||||
// ? new sst.aws.Vpc("Vpc", {
|
||||
// az: 2,
|
||||
// })
|
||||
// //FIXME: Change this ID
|
||||
// : undefined //sst.aws.Vpc.get("Vpc", "vpc-070a1a7598f4c12d1");
|
||||
// //
|
||||
|
||||
export const vpc = new sst.aws.Vpc("NestriVpc", {
|
||||
az: 2,
|
||||
// For lambdas to work in this VPC
|
||||
nat: "ec2",
|
||||
// For SST tunnel to work
|
||||
bastion: true
|
||||
})
|
||||
export const vpc = isPermanentStage
|
||||
? new sst.aws.Vpc("VPC", {
|
||||
az: 2,
|
||||
// For lambdas to work in this VPC
|
||||
nat: "ec2",
|
||||
// For SST tunnel to work
|
||||
bastion: true,
|
||||
})
|
||||
: sst.aws.Vpc.get("VPC", "vpc-0beb1cdc21a725748");
|
||||
Reference in New Issue
Block a user