-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
83 lines (75 loc) · 1.78 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
service: xlsx-export
provider:
name: aws
runtime: python2.7
region: us-east-1
stage: dev
memorySize: 1536
timeout: 300
# you can add statements to the Lambda function's IAM Role here
# iamRoleStatements:
# - Effect: "Allow"
# Action:
# - "s3:ListBucket"
# Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
# - Effect: "Allow"
# Action:
# - "s3:PutObject"
# Resource:
# Fn::Join:
# - ""
# - - "arn:aws:s3:::"
# - "Ref" : "ServerlessDeploymentBucket"
iamRoleStatements:
- Effect: Allow
Action:
- s3:*
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
Resource: "*"
# you can overwrite defaults here
#defaults:
# stage: dev
# region: us-east-1
# you can add packaging information here
#package:
# include:
# - include-me.js
# exclude:
# - exclude-me.js
# artifact: my-service-code.zip
functions:
fetchData:
handler: handler.export_to_xlsx
events:
- http:
path: export
method: get
cors: true
# - s3: ${env.BUCKET}
# - schedule: rate(10 minutes)
# - sns: greeter-topic
resources:
Resources:
xlsxBucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicReadWrite
BucketName: xlsx-export
LifecycleConfiguration:
Rules:
- ExpirationInDays: 1
Status: Enabled
DeletionPolicy: Retain
# you can add CloudFormation resource templates here
#resources:
# Resources:
# NewResource:
# Type: AWS::S3::Bucket
# Properties:
# BucketName: my-new-bucket
# Outputs:
# NewOutput:
# Description: "Description for the output"
# Value: "Some output value