Remove drizzle and serverless infra. Add terraform deployment.

This commit is contained in:
Patrick Fic
2026-01-19 13:49:19 -08:00
parent fefbd45570
commit bcdc305251
30 changed files with 713 additions and 329 deletions

View File

@@ -2,10 +2,6 @@ service: esdp-api
app: esdp-api-app
frameworkVersion: '4'
package:
patterns:
- drizzle/**
stages:
prod:
# Enables observability in the prod stage
@@ -17,8 +13,6 @@ stages:
domain: es.imex.online
es_user: Imex2
es_password: Patrick
infra_service: esdp-infra
infra_stage: shared
beta:
# Enables observability in the prod stage
observability: false
@@ -29,8 +23,6 @@ stages:
domain: beta.es.imex.online
es_user: Imex2
es_password: Patrick
infra_service: esdp-infra
infra_stage: shared
alpha:
# Enables observability in the prod stage
observability: false
@@ -40,8 +32,6 @@ stages:
domain: alpha.es.imex.online
es_user: Imex2
es_password: Patrick
infra_service: esdp-infra
infra_stage: shared
dev:
# Enables observability in the prod stage
observability: false
@@ -51,17 +41,6 @@ stages:
domain: dev.es.imex.online
es_user: Imex2
es_password: Patrick
infra_service: esdp-infra
infra_stage: shared
custom:
infra_stack: ${param:infra_service}-${param:infra_stage}
db:
host: ${cf:${self:custom.infra_stack}.DbProxyEndpoint}
port: ${cf:${self:custom.infra_stack}.DbPort}
name: ${cf:${self:custom.infra_stack}.DbName}
secretArn: ${cf:${self:custom.infra_stack}.DbSecretArn}
# params:
# dev:
@@ -81,31 +60,6 @@ provider:
httpApi: # This creates a cheaper, faster "HTTP API" Gateway
cors: true # Automatically configures CORS
# Ensure all Lambdas can reach the shared RDS Proxy in the infra VPC
vpc:
securityGroupIds:
- ${cf:${self:custom.infra_stack}.LambdaSecurityGroupId}
subnetIds:
- ${cf:${self:custom.infra_stack}.PrivateSubnetAId}
- ${cf:${self:custom.infra_stack}.PrivateSubnetBId}
# Default DB connection settings for all Lambdas (used by src/lib/db.ts)
environment:
DB_HOST: ${self:custom.db.host}
DB_PORT: ${self:custom.db.port}
DB_NAME: ${self:custom.db.name}
DB_SECRET_ARN: ${self:custom.db.secretArn}
# Allow Lambdas to fetch the DB credentials from Secrets Manager
iam:
role:
statements:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource:
- ${self:custom.db.secretArn}
build:
esbuild:
bundle: true
@@ -151,28 +105,6 @@ functions:
path: /emsupload
method: post
dbMigrate:
handler: src/handlers/dbMigrate.handler
timeout: 30
memorySize: 512
iamRoleStatements:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource:
- ${cf:${self:custom.infra_stack}.DbSecretArn}
dbPing:
handler: src/handlers/dbPing.handler
timeout: 15
memorySize: 256
iamRoleStatements:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource:
- ${cf:${self:custom.infra_stack}.DbSecretArn}
resources:
Resources:
UploadBucket: