Skip to content

Commit

Permalink
fix(living-documentation): generate dashboard immediately after creation
Browse files Browse the repository at this point in the history
The CW alarm event-driven invocation of the generator Lambda would be
too late since it triggers when the alarm is green.

So we move from event based trigger to scheduler every minute, which is
still covered by Lambda free tier and frees us from timing pains.

There might be still some gap between initial creation of the RootMail
alarm and the first call of the dashboard generator Lambda which would
result in exceptions in the generator Lambda. This was a deliberate
tradeoff.
  • Loading branch information
Soenke Ruempler authored and s0enke committed Apr 15, 2021
1 parent 97aa66e commit 9f99bd0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions templates/living-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Events:
EmailHealth:
Type: CloudWatchEvent
Schedule:
Type: Schedule
Properties:
Pattern:
detail-type:
- CloudWatch Alarm State Change
source:
- aws.cloudwatch
detail:
alarmName:
- superwerker-RootMailReady
Schedule: rate(1 minute) # runs in Lambda free tier

Handler: index.handler
Policies:
Expand Down

0 comments on commit 9f99bd0

Please sign in to comment.