Skip to content

Commit f3f9c18

Browse files
committed
feat: added DLQ to Pipe
1 parent 8e4fc17 commit f3f9c18

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
@@ -357,6 +357,9 @@ Resources:
357357
Source: !GetAtt ContractsTable.StreamArn
358358
SourceParameters:
359359
DynamoDBStreamParameters:
360+
MaximumRetryAttempts: 3
361+
DeadLetterConfig:
362+
Arn: !GetAtt ContractsTableStreamToEventPipeDLQ.Arn
360363
StartingPosition: LATEST
361364
OnPartialBatchItemFailure: AUTOMATIC_BISECT
362365
BatchSize: 1
@@ -390,7 +393,7 @@ Resources:
390393
Principal:
391394
Service: pipes.amazonaws.com
392395
Policies:
393-
- PolicyName: AllowDdbStreamRead
396+
- PolicyName: ContractsTableStreamToEventPipePolicy
394397
PolicyDocument:
395398
Version: "2012-10-17"
396399
Statement:
@@ -408,6 +411,26 @@ Resources:
408411
Action:
409412
- events:PutEvents
410413
Resource: !GetAtt UnicornContractsEventBus.Arn
414+
- Effect: Allow
415+
Action:
416+
- sqs:SendMessage
417+
Resource: !GetAtt ContractsTableStreamToEventPipeDLQ.Arn
418+
419+
ContractsTableStreamToEventPipeDLQ:
420+
Type: AWS::SQS::Queue
421+
UpdateReplacePolicy: Delete
422+
DeletionPolicy: Delete
423+
Properties:
424+
SqsManagedSseEnabled: true
425+
MessageRetentionPeriod: 1209600 # Maximum value, 1,209,600 (14days)
426+
QueueName: !Sub ContractsTableStreamToEventPipeDLQ-${Stage}
427+
Tags:
428+
- Key: stage
429+
Value: !Ref Stage
430+
- Key: project
431+
Value: !FindInMap [Constants, ProjectName, Value]
432+
- Key: namespace
433+
Value: !Sub "{{resolve:ssm:/uni-prop/${Stage}/UnicornContractsNamespace}}"
411434

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

0 commit comments

Comments
 (0)