-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define failure modes for Lambdas (#29)
* Defined failure modes for monitoring lambdas * Fixed lambdas implementation and tests accordingly to failure modes * Defined failure mode for aggregate worker * Created sqs queues and eventbridge rules for event delivery * Added policies to allow EventBridge to push to SQS
- Loading branch information
Rocco Zanni
authored
Nov 3, 2023
1 parent
decbc24
commit 233cd64
Showing
14 changed files
with
230 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,74 @@ | ||
Resources: | ||
BlackholeDeadletterQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-blackhole | ||
MessageRetentionPeriod: 60 | ||
ArchiveDeadletterQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-archive-deadletter | ||
MessageRetentionPeriod: 604800 | ||
ArchiveRawQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-archive-raw | ||
VisibilityTimeout: 60 | ||
RedrivePolicy: | ||
maxReceiveCount: 5 | ||
deadLetterTargetArn: | ||
Fn::GetAtt: | ||
- ArchiveDeadletterQueue | ||
- Arn | ||
ArchiveRawQueuePolicy: | ||
Type: AWS::SQS::QueuePolicy | ||
Properties: | ||
PolicyDocument: | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: events.amazonaws.com | ||
Action: SQS:SendMessage | ||
Resource: | ||
Fn::GetAtt: | ||
- ArchiveRawQueue | ||
- Arn | ||
Queues: | ||
- Ref: ArchiveRawQueue | ||
ArchiveDatabaseQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-archive-database | ||
VisibilityTimeout: 60 | ||
RedrivePolicy: | ||
maxReceiveCount: 5 | ||
deadLetterTargetArn: | ||
Fn::GetAtt: | ||
- ArchiveDeadletterQueue | ||
- Arn | ||
ArchiveDatabaseQueuePolicy: | ||
Type: AWS::SQS::QueuePolicy | ||
Properties: | ||
PolicyDocument: | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: events.amazonaws.com | ||
Action: SQS:SendMessage | ||
Resource: | ||
Fn::GetAtt: | ||
- ArchiveDatabaseQueue | ||
- Arn | ||
Queues: | ||
- Ref: ArchiveDatabaseQueue | ||
AggregateQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-aggregate | ||
VisibilityTimeout: 60 | ||
VisibilityTimeout: 60 | ||
RedrivePolicy: | ||
maxReceiveCount: 1 | ||
deadLetterTargetArn: | ||
Fn::GetAtt: | ||
- BlackholeDeadletterQueue | ||
- Arn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import assert from 'node:assert/strict'; | ||
|
||
export const throwsAsync = async function (promise, error) { | ||
let f = () => { }; | ||
try { | ||
await promise; | ||
} catch (e) { | ||
f = () => { throw e }; | ||
} finally { | ||
assert.throws(f, error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
Resources: | ||
BlackholeDeadletterQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-blackhole | ||
MessageRetentionPeriod: 60 | ||
CheckEndpointQueue: | ||
Type: AWS::SQS::Queue | ||
Properties: | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-check-endpoint | ||
QueueName: ${self:custom.appPrefix}-${opt:stage}-check-endpoint | ||
RedrivePolicy: | ||
maxReceiveCount: 1 | ||
deadLetterTargetArn: | ||
Fn::GetAtt: | ||
- BlackholeDeadletterQueue | ||
- Arn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.