-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
32 lines (29 loc) · 1 KB
/
serverless.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
service: LambdaAtEdge
provider:
name: aws
runtime: nodejs8.10
region: us-east-1
resources:
Resources:
LambdaAtEdgeRole:
Type: AWS::IAM::Role
Properties:
RoleName: lambda-at-edge-role
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
# we give access to the Lambda and Lambda@Edge service to assume our role
Service:
- lambda.amazonaws.com
- edgelambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
# we are giving access to write to cloudwatch logs, managed policies are very permissive
# consider writing your own more restrictive policies
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
functions:
cache-control:
handler: handler.handler # <filename>.<exported-function>
role: LambdaAtEdgeRole # we reference the resource we created earlier