-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
95 lines (90 loc) · 3.09 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
84
85
86
87
88
89
90
91
92
93
94
95
service: ${env:APP_NAME, 'tshAcademySlsWorkshops'}${env:STUDENT_NAME, 'student00'}
useDotenv: true
plugins:
- serverless-step-functions-local
- serverless-step-functions
- serverless-webpack
- serverless-offline
- serverless-plugin-log-retention
package:
individually: true
custom:
accountId: ${env:ACCOUNT_ID}
studentId: ${env:STUDENT_NAME, 'student00'}
logRetentionInDays: 30
webpack:
webpackConfig: "webpack.config.js"
packager: "npm"
stepFunctionsLocal:
accountId: ${env:ACCOUNT_ID}
region: us-east-1
inputBucketName: tsh-academy-serverless-workshops-input-bucket-${env:STUDENT_NAME, 'student00'}
extractedFilesBucketName: tsh-academy-serverless-workshops-extracted-files-${env:STUDENT_NAME, 'student00'}
matchedFilesBucketName: tsh-academy-serverless-workshops-matched-files-${env:STUDENT_NAME, 'student00'}
rejectedFilesBucketName: tsh-academy-serverless-workshops-rejected-files-${env:STUDENT_NAME, 'student00'}
provider:
name: aws
runtime: nodejs14.x
region: ${env:AWS_LAMBDAS_REGION, 'eu-west-1'}
stage: ${opt:stage, 'dev'}
memorySize: 256
timeout: 30
environment:
APP_NAME: ${env:APP_NAME, 'tshAcademySlsWorkshops'}
AWS_LAMBDAS_REGION: ${env:AWS_LAMBDAS_REGION, 'eu-west-1'}
STUDENT_NAME: ${env:STUDENT_NAME, 'student00'}
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
- states:StartExecution
Resource:
- "*"
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
- sns:Publish
- sns:Subscribe
Resource:
- "*"
functions:
- ${file(functions/scan-file/function.yml)}
- ${file(workflows/scan-cv-workflow/copy-file/function.yml)}
- ${file(workflows/scan-cv-workflow/check-node-experience/function.yml)}
- ${file(workflows/scan-cv-workflow/check-it-experience/function.yml)}
- ${file(workflows/scan-cv-workflow/check-cloud-experience/function.yml)}
- ${file(workflows/scan-cv-workflow/check-exclude-list/function.yml)}
- ${file(workflows/scan-cv-workflow/calculate-score/function.yml)}
- ${file(workflows/scan-cv-workflow/extract-text/function.yml)}
stepFunctions:
stateMachines:
ScanCvWorkflow: ${file(workflows/scan-cv-workflow/workflow.yml)}
resources:
Outputs:
ScanCvWorkflowStateMachine:
Description: Scan CV workflow state machine Arn
Value:
Ref: ScanCvWorkflow${self:service}${opt:stage, 'dev'}
Resources:
scanSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: ${self:service}ScanFailedTopic
inputBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.inputBucketName}
extractedFilesBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.extractedFilesBucketName}
matchedFilesBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.matchedFilesBucketName}
rejectedFilesBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.rejectedFilesBucketName}
ScanCvWorkflowStateMachineRole: ${file(workflows/scan-cv-workflow/workflow.iam.yml)}