forked from aws-samples/aws-lambda-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
61 lines (55 loc) · 1.66 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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: >
nodejs-example-logs-api-extension
Sample SAM Template for nodejs-example-logs-api-extension
Globals:
Function:
Timeout: 5
Resources:
NodeJSExampleExtensionLayer:
Type: AWS::Serverless::LayerVersion
Metadata:
BuildMethod: makefile
Properties:
LayerName: nodejs-example-logs-api-extension
Description: NodeJS Logs API Example Lambda Extension Layer
ContentUri: .
CompatibleRuntimes:
- nodejs12.x
LicenseInfo: MIT-0
RetentionPolicy: Delete
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: nodejs-example-logs-api-extension-demo-function
CodeUri: hello-world/
Handler: app.lambdaHandler
Runtime: nodejs12.x
Layers:
- !Ref NodeJSExampleExtensionLayer
Environment:
Variables:
LOGS_S3_BUCKET_NAME:
Ref: LogExtensionsBucket
Policies:
- S3WritePolicy:
BucketName: !Ref LogExtensionsBucket
LogExtensionsBucket:
Type: 'AWS::S3::Bucket'
Properties:
LifecycleConfiguration:
Rules:
- Id: DeleteAfterSevenDays
Status: "Enabled"
ExpirationInDays: 7
Outputs:
NodeJSExampleExtensionLayer:
Description: NodeJS Logs Example Lambda Extension Layer Version ARN
Value: !Ref NodeJSExampleExtensionLayer
HelloWorldFunction:
Description: First Lambda Function ARN
Value: !GetAtt HelloWorldFunction.Arn
HelloWorldFunctionIamRole:
Description: Implicit IAM Role created for Hello World function
Value: !GetAtt HelloWorldFunctionRole.Arn