-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
74 lines (68 loc) · 2.56 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
service: bamboo-tracker
custom:
timesheetS3Key: timesheet.yml
provider:
name: aws
runtime: go1.x
stackTags:
ENVIRONMENT: ${self:provider.stage}
PROJECT: ${self:service}-${self:provider.stage}
deploymentBucket:
name: ${self:service}-deployment-bucket-${self:provider.region}-${self:provider.stage}
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'eu-central-1'}
logRetentionInDays: 7
iamRoleStatements:
- Effect: 'Allow'
Action:
- 's3:GetObject'
Resource:
Fn::Join:
- '/'
- - !GetAtt ['TimesheetsBucket', Arn]
- ${self:custom.timesheetS3Key}
- Effect: 'Allow'
Action:
- 'ses:SendEmail'
Resource:
'arn:aws:ses:${self:provider.region}:*:identity/${env:DAILY_TIME_TRACKING_SENDER_EMAIL}'
package:
exclude:
- ./**
include:
- ./bin/**
functions:
step_getTodaysTimesheet:
handler: bin/lambda/getTodaysTimesheet
environment:
TIMESHEET_S3_KEY: ${self:custom.timesheetS3Key}
TIMESHEET_S3_BUCKET: !Ref 'TimesheetsBucket'
step_uploadTimesheet:
handler: bin/lambda/uploadTimesheet
environment:
BAMBOO_HOST: ${env:BAMBOO_HOST}
BAMBOO_USERNAME: ${env:BAMBOO_USERNAME}
BAMBOO_PASSWORD: ${env:BAMBOO_PASSWORD}
step_retrieveCurrentTimeTracking:
handler: bin/lambda/retrieveCurrentTimeTracking
environment:
BAMBOO_HOST: ${env:BAMBOO_HOST}
BAMBOO_USERNAME: ${env:BAMBOO_USERNAME}
BAMBOO_PASSWORD: ${env:BAMBOO_PASSWORD}
step_prepareTimeTrackingEmailPayload:
handler: bin/lambda/prepareTimeTrackingEmailPayload
environment:
DAILY_TIME_TRACKING_SENDER_EMAIL: ${env:DAILY_TIME_TRACKING_SENDER_EMAIL}
DAILY_TIME_TRACKING_RECIPIENT_EMAIL: ${env:DAILY_TIME_TRACKING_RECIPIENT_EMAIL}
step_sendNotificationEmail:
handler: bin/lambda/sendNotificationEmail
resources:
Resources:
TimesheetsBucket: ${file(./resources/S3/TimesheetsBucket.yml):Bucket}
StateMachineExecutionRole: ${file(./resources/IAM/StateMachineExecutionRole.yml):Role}
EventBridgeExecutionRole: ${file(./resources/IAM/EventBridgeExecutionRole.yml):Role}
UploadTimesheetStateMachine: ${file(./resources/StepFunctions/UploadTimesheetStateMachine.yml):StateMachine}
UploadTimesheetFailedStateRule: ${file(./resources/Events/UploadTimesheetFailedStateRule.yml):Rule}
UploadTimesheetRule: ${file(./resources/Events/UploadTimesheetRule.yml):Rule}
MonitoringTopic: ${file(./resources/SNS/MonitoringTopic.yml):Topic}
MonitoringTopicPolicy: ${file(./resources/SNS/MonitoringTopicPolicy.yml):TopicPolicy}