backend/lib/seed/devops/serverless-app.yaml
2025-05-14 21:45:16 +02:00

61 lines
1.7 KiB
YAML

app: ${file(./package.json):name}
service: app
package:
individually: true
provider:
name: aws
stage: ${opt:stage,'dev'}
runtime: nodejs12.x
environment:
AWS_Hooks: hooks-${self:provider.stage}-hookHandler
S3_BUCKET: ${self:app}-appdata
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: '*'
- Effect: Allow
Action:
- s3:*
Resource: arn:aws:s3:::${self:provider.environment.S3_BUCKET}/*
plugins:
- serverless-webpack
- serverless-domain-manager
- serverless-offline
custom:
stage: ${opt:stage, self:provider.stage}
domains: ${file(./config/domains.yaml):domains}
customDomain: ${file(./config/domains.yaml):customDomain}
serverless-offline:
httpPort: 4000
lambdaPort: 4010
webpack:
webpackConfig: './lib/seed/webpack.config.js' # Name of webpack configuration file
includeModules:
forceExclude:
- aws-sdk
- puppeteer
functions:
app:
handler: handler.appHandler
timeout: 60
events:
- http:
path: /
method: post
cors:
origin: '*'
headers:
- Content-Type
- Authorization
- X-Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
- organisationid
- http:
path: /
method: get
cors: true