-
Notifications
You must be signed in to change notification settings - Fork 6
/
serverless.yml
51 lines (46 loc) · 1.16 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
service:
name: hexagonal-lambda
plugins:
- serverless-webpack
provider:
name: aws
stage: ${opt:stage, 'dev'}
runtime: nodejs10.x
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectAcl
Resource: "arn:aws:s3:::${self:custom.finalBillBucketName}/*"
custom:
finalBillBucketName: final-bill-bucket-${self:provider.stage}
functions:
closeAccountHttp:
handler: handlerHttp.handler
events:
- http:
method: DELETE
path: account/{id}
request:
parameters:
paths:
id: true
closeAccountS3:
handler: handlerS3.handler
events:
- s3: ${self:custom.finalBillBucketName}
event: s3:ObjectCreated:*
resources:
Resources:
FinalBillBucketLambdaPermission:
Type: "AWS::Lambda::Permission"
Properties:
FunctionName:
"Fn::GetAtt":
- CloseAccountS3LambdaFunction
- Arn
Principal: "s3.amazonaws.com"
Action: "lambda:InvokeFunction"
SourceAccount:
Ref: AWS::AccountId
SourceArn: "arn:aws:s3:::${self:custom.finalBillBucketName}"