Skip to content

Commit 10f789d

Browse files
committed
some name changes to approvals. Moved example events to other folder for parity with TypeScript version and workshop description
1 parent 7d9884e commit 10f789d

22 files changed

+19
-19
lines changed

unicorn_approvals/template.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ Resources:
116116
MaximumRetryAttempts: 5
117117
MaximumEventAgeInSeconds: 900
118118
DeadLetterConfig:
119-
Arn: !GetAtt PropertiesEventBusRuleDLQ.Arn
119+
Arn: !GetAtt ApprovalsEventBusRuleDLQ.Arn
120120
EventInvokeConfig:
121121
DestinationConfig:
122122
OnFailure:
123123
Type: SQS
124-
Destination: !GetAtt PropertiesServiceDLQ.Arn
124+
Destination: !GetAtt ApprovalsServiceDLQ.Arn
125125

126126
# Log group for the ContractStatusChangedHandlerFunction
127127
ContractStatusChangedHandlerFunctionLogGroup:
@@ -146,7 +146,7 @@ Resources:
146146
StreamName:
147147
!Select [3, !Split ["/", !GetAtt ContractStatusTable.StreamArn]]
148148
- SQSSendMessagePolicy:
149-
QueueName: !GetAtt PropertiesServiceDLQ.QueueName
149+
QueueName: !GetAtt ApprovalsServiceDLQ.QueueName
150150
- Statement:
151151
- Effect: Allow
152152
Action:
@@ -163,12 +163,12 @@ Resources:
163163
MaximumRetryAttempts: 3
164164
DestinationConfig:
165165
OnFailure:
166-
Destination: !GetAtt PropertiesServiceDLQ.Arn
166+
Destination: !GetAtt ApprovalsServiceDLQ.Arn
167167
EventInvokeConfig:
168168
DestinationConfig:
169169
OnFailure:
170170
Type: SQS
171-
Destination: !GetAtt PropertiesServiceDLQ.Arn
171+
Destination: !GetAtt ApprovalsServiceDLQ.Arn
172172

173173
# Log group for the PropertiesApprovalSyncFunction
174174
PropertiesApprovalSyncFunctionLogGroup:
@@ -243,7 +243,7 @@ Resources:
243243
PublicationApprovalRequestedEvent:
244244
Type: EventBridgeRule
245245
Properties:
246-
RuleName: unicorn.properties-PublicationApprovalRequested
246+
RuleName: unicorn.approvals-PublicationApprovalRequested
247247
EventBusName: !GetAtt UnicornApprovalsEventBus.Name
248248
Pattern:
249249
source:
@@ -255,7 +255,7 @@ Resources:
255255
MaximumEventAgeInSeconds: 900
256256
DeadLetterConfig:
257257
Type: SQS
258-
Destination: !GetAtt PropertiesServiceDLQ.Arn
258+
Destination: !GetAtt ApprovalsServiceDLQ.Arn
259259
DefinitionSubstitutions:
260260
WaitForContractApprovalArn: !GetAtt WaitForContractApprovalFunction.Arn
261261
TableName: !Ref ContractStatusTable
@@ -274,7 +274,7 @@ Resources:
274274

275275
#### DEAD LETTER QUEUES
276276
# Store EventBridge events that failed to be DELIVERED to ContractStatusChangedHandlerFunction
277-
PropertiesEventBusRuleDLQ:
277+
ApprovalsEventBusRuleDLQ:
278278
Type: AWS::SQS::Queue
279279
UpdateReplacePolicy: Delete
280280
DeletionPolicy: Delete
@@ -290,7 +290,7 @@ Resources:
290290
Value: !Ref Stage
291291

292292
# Store failed INVOCATIONS to each Lambda function in Unicorn Properties Service
293-
PropertiesServiceDLQ:
293+
ApprovalsServiceDLQ:
294294
Type: AWS::SQS::Queue
295295
UpdateReplacePolicy: Delete
296296
DeletionPolicy: Delete
@@ -338,13 +338,13 @@ Resources:
338338
Name: !Sub UnicornPropertiesBus-${Stage}
339339

340340
# Event bus policy to restrict who can publish events (should only be services from UnicornApprovalsNamespace)
341-
UnicornPropertiesEventsBusPublishPolicy:
341+
UnicornApprovalsEventsBusPublishPolicy:
342342
Type: AWS::Events::EventBusPolicy
343343
DeletionPolicy: Delete
344344
UpdateReplacePolicy: Delete
345345
Properties:
346346
EventBusName: !Ref UnicornApprovalsEventBus
347-
StatementId: !Sub OnlyPropertiesServiceCanPublishToEventBus-${Stage}
347+
StatementId: !Sub OnlyApprovalsServiceCanPublishToEventBus-${Stage}
348348
Statement:
349349
Effect: Allow
350350
Principal:
@@ -358,12 +358,12 @@ Resources:
358358
- "{{resolve:ssm:/uni-prop/UnicornApprovalsNamespace}}"
359359

360360
# Catchall rule used for development purposes. Logs all events matching any of the services to CloudWatch Logs
361-
UnicornPropertiesCatchAllRule:
361+
UnicornApprovalsCatchAllRule:
362362
Type: AWS::Events::Rule
363363
DeletionPolicy: Delete
364364
UpdateReplacePolicy: Delete
365365
Properties:
366-
Name: properties.catchall
366+
Name: approvals.catchall
367367
Description: Catchall rule used for development purposes.
368368
EventBusName: !Ref UnicornApprovalsEventBus
369369
EventPattern:
@@ -375,11 +375,11 @@ Resources:
375375
- "{{resolve:ssm:/uni-prop/UnicornWebNamespace}}"
376376
State: ENABLED #You may want to disable this rule in production
377377
Targets:
378-
- Arn: !GetAtt UnicornPropertiesCatchAllLogGroup.Arn
379-
Id: !Sub UnicornPropertiesCatchAllLogGroupTarget-${Stage}
378+
- Arn: !GetAtt UnicornApprovalsCatchAllLogGroup.Arn
379+
Id: !Sub UnicornApprovalsCatchAllLogGroupTarget-${Stage}
380380

381381
# CloudWatch log group used to catch all events
382-
UnicornPropertiesCatchAllLogGroup:
382+
UnicornApprovalsCatchAllLogGroup:
383383
Type: AWS::Logs::LogGroup
384384
UpdateReplacePolicy: Delete
385385
DeletionPolicy: Delete
@@ -413,7 +413,7 @@ Resources:
413413
"logs:PutLogEvents"
414414
],
415415
"Resource": [
416-
"${UnicornPropertiesCatchAllLogGroup.Arn}"
416+
"${UnicornApprovalsCatchAllLogGroup.Arn}"
417417
]
418418
}
419419
]
@@ -487,9 +487,9 @@ Outputs:
487487
Value: !GetAtt UnicornApprovalsEventBus.Name
488488

489489
#### CLOUDWATCH LOGS OUTPUTS
490-
UnicornPropertiesCatchAllLogGroupArn:
490+
UnicornApprovalsCatchAllLogGroupArn:
491491
Description: Log all events on the service's EventBridge Bus
492-
Value: !GetAtt UnicornPropertiesCatchAllLogGroup.Arn
492+
Value: !GetAtt UnicornApprovalsCatchAllLogGroup.Arn
493493

494494
ApprovalStateMachineLogGroupName:
495495
Value: !Ref ApprovalStateMachineLogGroup

unicorn_approvals/tests/unit/events/ddb_stream_events/contract_status_changed_draft.json renamed to unicorn_approvals/tests/events/ddb_stream_events/contract_status_changed_draft.json

File renamed without changes.

unicorn_approvals/tests/unit/events/ddb_stream_events/sfn_check_exists.json renamed to unicorn_approvals/tests/events/ddb_stream_events/sfn_check_exists.json

File renamed without changes.

unicorn_approvals/tests/unit/events/ddb_stream_events/sfn_wait_approval.json renamed to unicorn_approvals/tests/events/ddb_stream_events/sfn_wait_approval.json

File renamed without changes.

unicorn_approvals/tests/unit/events/ddb_stream_events/status_approved_waiting_for_approval.json renamed to unicorn_approvals/tests/events/ddb_stream_events/status_approved_waiting_for_approval.json

File renamed without changes.

unicorn_approvals/tests/unit/events/ddb_stream_events/status_approved_with_no_workflow.json renamed to unicorn_approvals/tests/events/ddb_stream_events/status_approved_with_no_workflow.json

File renamed without changes.

unicorn_approvals/tests/unit/events/eventbridge/contract_status_changed.json renamed to unicorn_approvals/tests/events/eventbridge/contract_status_changed.json

File renamed without changes.

unicorn_approvals/tests/unit/events/eventbridge/contract_status_changed_event_contract_1_approved.json renamed to unicorn_approvals/tests/events/eventbridge/contract_status_changed_event_contract_1_approved.json

File renamed without changes.

unicorn_approvals/tests/unit/events/eventbridge/contract_status_changed_event_contract_1_draft.json renamed to unicorn_approvals/tests/events/eventbridge/contract_status_changed_event_contract_1_draft.json

File renamed without changes.

unicorn_approvals/tests/unit/events/eventbridge/contract_status_changed_event_contract_2_approved.json renamed to unicorn_approvals/tests/events/eventbridge/contract_status_changed_event_contract_2_approved.json

File renamed without changes.

0 commit comments

Comments
 (0)