forked from ubaniabalogun/uscis-case-status-notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
60 lines (52 loc) · 1.58 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
service:
name: uscis-case-status-notifier
provider:
name: aws
runtime: python3.6
variableSyntax: "\\${{([ ~:a-zA-Z0-9._\\'\",\\-\\/\\(\\)]+?)}}"
stage: ${{opt:stage, 'dev'}}
region: ${{opt:region, 'us-west-2'}}
memorySize: 512
timeout: 10
versionFunctions: false
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:PutItem"
- "dynamodb:GetItem"
- "dynamodb:Scan"
- "dynamodb:Query"
- "dynamodb:UpdateItem"
Resource:
Fn::GetAtt: [USCISCasesTable, Arn]
package:
individually: true
plugins:
- serverless-package-python-functions
custom:
packageJson: severless-admin
pkgPyFuncs:
buildDir: _build
functions:
SendCaseStatusUpdate:
name: uscis_send_case_status_update
handler: lambda_function.lambda_handler
environment:
TWILIO_AUTH_TOKEN: ${{ssm:/twilio/auth_token~true}}
TWILIO_ACCOUNT_SID: ${{ssm:/twilio/account_sid~true}}
TWILIO_PHONE_NUMBER: ${{ssm:/twilio/phonenumber~true}}
RECIPIENT_NUMBER: ${{ssm:/uscis/recipient_number~true}}
RECEIPT_NUMBER: ${{ssm:/uscis/receipt_number~true}}
CASE_STATUS_TABLE:
Ref: USCISCasesTable
package:
include:
- functions/send_case_status_update
artifact: ${{self:custom.pkgPyFuncs.buildDir}}/${{self:functions.SendCaseStatusUpdate.name}}.zip
events:
- schedule:
name: uscis-case-status-notifier-cron
description: 'Cron job for executing uscis-case-status-notifier application'
rate: cron(0 17 * * ? 2018)
resources:
- ${{file(resources/dynamodb.yaml)}}