-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.example.yml
47 lines (44 loc) · 1.19 KB
/
serverless.example.yml
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
service: AnalyticsAPI
frameworkVersion: "3"
provider:
name: aws
runtime: nodejs16.x
memorySize: 2048
stage: ${opt:stage, 'dev'}
timeout: 30
region: sa-east-1
environment:
JWT_KEY: "YOUR_JWT_KEY"
GOOGLE_APPLICATION_CREDENTIALS: "YOUR_PATH_TO_GOOGLE_APPLICATION_CREDENTIALS.json"
functions:
AnalyticsHandler:
handler: dist/handler.AnalyticsHandler
events:
- http: ANY /{proxy+}
- http: ANY /
resources:
Resources:
AnalyticsServiceRole:
Type: AWS::IAM::Role
Properties:
RoleName: AnalyticsServiceRole
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action:
- sts:AssumeRole
Policies:
- PolicyName: LambdaPolicy
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource: "arn:aws:logs:*:*:*"