-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathserverless.yml
35 lines (35 loc) · 889 Bytes
/
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
service: pdf-service
provider:
name: aws
runtime: python3.7
# Set environment variable for the S3 bucket
environment:
S3_BUCKET_NAME: ${file(./config.yml):BucketName}
# Gives our functions full read and write access to the S3 Bucket
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
- arn:aws:s3:::${file(./config.yml):BucketName}
- arn:aws:s3:::${file(./config.yml):BucketName}/*
functions:
generate_pdf:
handler: handler.generate_pdf
events:
- http:
path: new-pdf
method: post
cors: true
resources:
# Creates an S3 bucket in our AWS account
Resources:
NewResource:
Type: AWS::S3::Bucket
Properties:
BucketName: ${file(./config.yml):BucketName}
custom:
pythonRequirements:
dockerizePip: true
plugins:
- serverless-python-requirements