Skip to content

Commit 9878893

Browse files
committed
feat: added DLQ to Pipe
1 parent 1b15c43 commit 9878893

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

Unicorn.Contracts/template.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ Resources:
358358
Source: !GetAtt ContractsTable.StreamArn
359359
SourceParameters:
360360
DynamoDBStreamParameters:
361+
MaximumRetryAttempts: 3
362+
DeadLetterConfig:
363+
Arn: !GetAtt ContractsTableStreamToEventPipeDLQ.Arn
361364
StartingPosition: LATEST
362365
OnPartialBatchItemFailure: AUTOMATIC_BISECT
363366
BatchSize: 1
@@ -391,7 +394,7 @@ Resources:
391394
Principal:
392395
Service: pipes.amazonaws.com
393396
Policies:
394-
- PolicyName: AllowDdbStreamRead
397+
- PolicyName: ContractsTableStreamToEventPipePolicy
395398
PolicyDocument:
396399
Version: "2012-10-17"
397400
Statement:
@@ -409,6 +412,26 @@ Resources:
409412
Action:
410413
- events:PutEvents
411414
Resource: !GetAtt UnicornContractsEventBus.Arn
415+
- Effect: Allow
416+
Action:
417+
- sqs:SendMessage
418+
Resource: !GetAtt ContractsTableStreamToEventPipeDLQ.Arn
419+
420+
ContractsTableStreamToEventPipeDLQ:
421+
Type: AWS::SQS::Queue
422+
UpdateReplacePolicy: Delete
423+
DeletionPolicy: Delete
424+
Properties:
425+
SqsManagedSseEnabled: true
426+
MessageRetentionPeriod: 1209600 # Maximum value, 1,209,600 (14days)
427+
QueueName: !Sub ContractsTableStreamToEventPipeDLQ-${Stage}
428+
Tags:
429+
- Key: stage
430+
Value: !Ref Stage
431+
- Key: project
432+
Value: !FindInMap [Constants, ProjectName, Value]
433+
- Key: namespace
434+
Value: !Sub "{{resolve:ssm:/uni-prop/${Stage}/UnicornContractsNamespace}}"
412435

413436
#### CLOUDFORMATION NESTED STACKS
414437
# CloudFormation Stack with the Contracts Service Event Registry and Schemas

0 commit comments

Comments
 (0)