-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
89 lines (81 loc) · 2.11 KB
/
serverless.yml
File metadata and controls
89 lines (81 loc) · 2.11 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
service: twitter-bio-generator-backend
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-esbuild
provider:
name: aws
stage: dev
region: eu-west-1
profile: kendi-hesabim
tracing:
lambda: true
runtime: nodejs18.x
memorySize: 512
timeout: 10
logRetentionInDays: 60
iam:
role:
statements:
- Effect: Allow
Action:
- 's3:*'
Resource: '*'
httpApi:
authorizers:
jwt:
type: jwt
identitySource: $request.header.Authorization
issuerUrl: https://dev-ukwn2fwyghycs35o.us.auth0.com/
audience: twitter-bio-generator-backend
cors:
allowedOrigins:
- https://twitter-bio-generator.selcukcihan.com
allowedHeaders:
- Content-Type
- Authorization
allowedMethods:
- GET
- OPTIONS
allowCredentials: true
maxAge: 3600
package:
individually: true
custom:
esbuild:
bundle: true
minify: false
sourcemap: true
exclude:
- aws-sdk
platform: 'node'
concurrency: 10
plugins: ./esbuild-plugins.js
resources:
Resources:
bioBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: cihan-twitter-bio-generator-backend-bucket
functions:
api:
handler: src/lambda/api.handler
timeout: 28
events:
- httpApi:
method: GET
path: /bio
authorizer:
name: jwt
environment:
BUCKET: ${self:resources.Resources.bioBucket.Properties.BucketName}
AUTH0_ADMIN_AUDIENCE: https://dev-ukwn2fwyghycs35o.us.auth0.com/api/v2/
AUTH0_ADMIN_CLIENT_SECRET: ${env:AUTH0_ADMIN_CLIENT_SECRET}
AUTH0_ADMIN_CLIENT_ID: ${env:AUTH0_ADMIN_CLIENT_ID}
AUTH0_TOKEN_URL: https://dev-ukwn2fwyghycs35o.us.auth0.com/oauth/token
AUTH0_ADMIN_GET_USER_URL: https://dev-ukwn2fwyghycs35o.us.auth0.com/api/v2/users/
TWITTER_CONSUMER_KEY: ${env:TWITTER_CONSUMER_KEY}
TWITTER_CONSUMER_SECRET: ${env:TWITTER_CONSUMER_SECRET}
OPENAI_API_KEY: ${env:OPENAI_API_KEY}
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
NODE_OPTIONS: '--enable-source-maps'