-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
68 lines (63 loc) · 1.87 KB
/
template.yaml
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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: Express Example
Globals:
Api:
# Logging, Metrics, Throttling, and all other Stage settings
MethodSettings: [{
# Turn on Info logging
"LoggingLevel": "INFO",
# Trace-level Logging
"DataTraceEnabled": True,
# On all Paths & methods
"ResourcePath": "/*",
"HttpMethod": "*",
}]
# Allows an application running locally on port 8080 to call this API
Cors:
AllowMethods: "'OPTIONS,POST'"
AllowHeaders: "'Content-Type'"
AllowOrigin: "'*'"
Resources:
ExpressExampleFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: "ExpressExampleLambdaFunction"
Handler: dist/lambda.handler
Runtime: nodejs10.x
MemorySize: 128
Timeout: 30
CodeUri: ./
Environment:
Variables:
NODE_ENV: production
Events:
WarmingSchedule:
Type: Schedule
Properties:
Schedule: rate(5 minutes)
Input: '{ "warmer":true,"concurrency":3 }'
ExpressExampleApi:
Type: Api
Properties:
Path: "/{proxy+}"
Method: any
Policies:
- LambdaInvokePolicy:
FunctionName: "ExpressExampleLambdaFunction"
- Statement:
- Effect: Allow
Action:
- "lambda:InvokeFunction"
Resource:
Fn::Join:
- ""
- - "arn:aws:lambda:us-east-1:"
- Ref: AWS::AccountId
- ":function:"
- "ExpressExampleLambdaFunction"
- ":$LATEST"
ApiGatewayLoggingAccount:
Type: AWS::ApiGateway::Account
Properties:
CloudWatchRoleArn: "arn:aws:iam::000000000000:role/xxxxxxxxxxxxxxxxxxxx"