1
1
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
# SPDX-License-Identifier: MIT-0
3
- AWSTemplateFormatVersion : 2010-09-09
3
+ AWSTemplateFormatVersion : " 2010-09-09"
4
4
Transform :
5
5
- AWS::LanguageExtensions
6
6
- AWS::Serverless-2016-10-31
@@ -12,10 +12,10 @@ Metadata:
12
12
config :
13
13
ignore_checks :
14
14
- ES4000 # Rule disabled because the CatchAll Rule doesn't need a DLQ
15
- - ES6000 # Rule disabled because SQS DLOs don't need a RedrivePolicy
15
+ - ES6000 # Rule disabled because SQS DLQs don't need a RedrivePolicy
16
16
- WS2001 # Rule disabled because check does not support !ToJsonString transform
17
17
- ES1001 # Rule disabled because our Lambda functions don't need DestinationConfig.OnFailure
18
- - W3002
18
+ - W3002 # Rule disabled as nested templates are being packaged
19
19
20
20
Parameters :
21
21
Stage :
@@ -54,19 +54,19 @@ Globals:
54
54
Environment :
55
55
Variables :
56
56
DYNAMODB_TABLE : !Ref ContractsTable
57
- SERVICE_NAMESPACE : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
57
+ SERVICE_NAMESPACE : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
58
58
POWERTOOLS_LOGGER_CASE : PascalCase
59
- POWERTOOLS_SERVICE_NAME : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
59
+ POWERTOOLS_SERVICE_NAME : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
60
60
POWERTOOLS_TRACE_DISABLED : " false" # Explicitly disables tracing, default
61
61
POWERTOOLS_LOGGER_LOG_EVENT : !If [IsProd, "false", "true"] # Logs incoming event, default
62
62
POWERTOOLS_LOGGER_SAMPLE_RATE : !If [IsProd, "0.1", "0"] # Debug log sampling percentage, default
63
- POWERTOOLS_METRICS_NAMESPACE : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
63
+ POWERTOOLS_METRICS_NAMESPACE : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
64
64
POWERTOOLS_LOG_LEVEL : INFO # Log level for Logger (INFO, DEBUG, etc.), default
65
65
LOG_LEVEL : INFO # Log level for Logger
66
66
Tags :
67
67
stage : !Ref Stage
68
68
project : !FindInMap [Constants, ProjectName, Value]
69
- namespace : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
69
+ namespace : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
70
70
71
71
Resources :
72
72
# ### SSM PARAMETERS
@@ -149,8 +149,9 @@ Resources:
149
149
Tags :
150
150
stage : !Ref Stage
151
151
project : !FindInMap [Constants, ProjectName, Value]
152
- namespace : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
152
+ namespace : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
153
153
154
+ # API GW Cloudwatch Log Group
154
155
UnicornContractsApiLogGroup :
155
156
Type : AWS::Logs::LogGroup
156
157
UpdateReplacePolicy : Delete
@@ -217,7 +218,7 @@ Resources:
217
218
- Key : project
218
219
Value : !FindInMap [Constants, ProjectName, Value]
219
220
- Key : namespace
220
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
221
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
221
222
222
223
# ### DEAD LETTER QUEUES
223
224
# DeadLetterQueue for UnicornContractsIngestQueue. Contains messages that failed to be processed
@@ -235,7 +236,7 @@ Resources:
235
236
- Key : project
236
237
Value : !FindInMap [Constants, ProjectName, Value]
237
238
- Key : namespace
238
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
239
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
239
240
240
241
# ### DYNAMODB TABLE
241
242
# Persist Contracts information in DynamoDB
@@ -259,7 +260,7 @@ Resources:
259
260
- Key : project
260
261
Value : !FindInMap [Constants, ProjectName, Value]
261
262
- Key : namespace
262
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
263
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
263
264
264
265
# ### EVENT BUS
265
266
# Event bus for Unicorn Contract Service used to publish and consume events
@@ -284,7 +285,7 @@ Resources:
284
285
Condition :
285
286
StringEquals :
286
287
events:source :
287
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
288
+ - " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
288
289
289
290
# Catchall rule used for development purposes.
290
291
UnicornContractsCatchAllRule :
@@ -297,9 +298,9 @@ Resources:
297
298
account :
298
299
- !Ref AWS::AccountId
299
300
source :
300
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
301
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornPropertiesNamespace}}"
302
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornWebNamespace}}"
301
+ - " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
302
+ - " {{resolve:ssm:/uni-prop/UnicornPropertiesNamespace}}"
303
+ - " {{resolve:ssm:/uni-prop/UnicornWebNamespace}}"
303
304
State : ENABLED # You may want to disable this rule in production
304
305
Targets :
305
306
- Arn : !GetAtt UnicornContractsCatchAllLogGroup.Arn
@@ -314,7 +315,7 @@ Resources:
314
315
LogGroupName : !Sub
315
316
- " /aws/events/${Stage}/${NS}-catchall"
316
317
- Stage : !Ref Stage
317
- NS : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
318
+ NS : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
318
319
RetentionInDays : !FindInMap
319
320
- LogsRetentionPeriodMap
320
321
- !Ref Stage
@@ -375,7 +376,7 @@ Resources:
375
376
Target : !GetAtt UnicornContractsEventBus.Arn
376
377
TargetParameters :
377
378
EventBridgeEventBusParameters :
378
- Source : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
379
+ Source : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
379
380
DetailType : ContractStatusChanged
380
381
InputTemplate : !ToJsonString
381
382
PropertyId : " <$.dynamodb.NewImage.PropertyId.S>"
@@ -431,12 +432,14 @@ Resources:
431
432
- Key : project
432
433
Value : !FindInMap [Constants, ProjectName, Value]
433
434
- Key : namespace
434
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
435
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
435
436
436
437
# ### CLOUDFORMATION NESTED STACKS
437
438
# CloudFormation Stack with the Contracts Service Event Registry and Schemas
438
439
EventSchemasStack :
439
440
Type : AWS::Serverless::Application
441
+ UpdateReplacePolicy : Delete
442
+ DeletionPolicy : Delete
440
443
Properties :
441
444
Location : " Integration/event-schemas.yaml"
442
445
Parameters :
@@ -445,6 +448,8 @@ Resources:
445
448
# CloudFormation Stack with the Cross-service EventBus policy for Contracts Service
446
449
SubscriberPoliciesStack :
447
450
Type : AWS::Serverless::Application
451
+ UpdateReplacePolicy : Delete
452
+ DeletionPolicy : Delete
448
453
DependsOn :
449
454
- UnicornContractsEventBusNameParam
450
455
Properties :
0 commit comments