This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
73 lines (67 loc) · 1.87 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
service: "${env:SERVERLESS_SERVICE_NAME}"
plugins:
- serverless-hooks-plugin
- serverless-finch
provider:
name: aws
runtime: ruby2.7
stage: prod
region: "${env:AWS_REGION}"
memorySize: 256
environment:
DYNAMODB_TABLE_EXAMPLE: ${self:service}-${opt:stage, self:provider.stage}-example
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:BatchWriteItem
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE_EXAMPLE}"
logRetentionInDays: 7
custom:
client:
bucketName: "${env:CLIENT_APPLICATION_DOMAIN}"
distributionFolder: "client/dist"
manageResources: false
hooks:
package:initialize:
- docker run --rm -v `pwd`:`pwd` -w `pwd` lambci/lambda:build-ruby2.7 bundle install --deployment --without development test
package:finalize:
- rm -rf .bundle
package:
exclude:
- 'node_modules/**'
functions:
example:
handler: app/handlers/example_handler.example_handler
events:
- http:
path: example
method: get
cors: true
cron:
handler: app/handlers/cron_handler.cron_handler
events:
- schedule: rate(15 minutes)
resources:
Resources:
ExampleDynamoDBTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Delete
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
TableName: ${self:provider.environment.DYNAMODB_TABLE_EXAMPLE}
BillingMode: PROVISIONED
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5