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,18 +54,18 @@ Globals:
54
54
Environment :
55
55
Variables :
56
56
DYNAMODB_TABLE : !Ref ContractsTable
57
- SERVICE_NAMESPACE : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
58
- POWERTOOLS_SERVICE_NAME : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
57
+ SERVICE_NAMESPACE : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
58
+ POWERTOOLS_SERVICE_NAME : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
59
59
POWERTOOLS_TRACE_DISABLED : " false" # Explicitly disables tracing, default
60
60
POWERTOOLS_LOGGER_LOG_EVENT : !If [IsProd, "false", "true"] # Logs incoming event, default
61
61
POWERTOOLS_LOGGER_SAMPLE_RATE : !If [IsProd, "0.1", "0"] # Debug log sampling percentage, default
62
- POWERTOOLS_METRICS_NAMESPACE : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
62
+ POWERTOOLS_METRICS_NAMESPACE : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
63
63
POWERTOOLS_LOG_LEVEL : INFO # Log level for Logger (INFO, DEBUG, etc.), default
64
64
LOG_LEVEL : INFO # Log level for Logger
65
65
Tags :
66
66
stage : !Ref Stage
67
67
project : !FindInMap [Constants, ProjectName, Value]
68
- namespace : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
68
+ namespace : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
69
69
70
70
Resources :
71
71
# ### SSM PARAMETERS
@@ -148,8 +148,9 @@ Resources:
148
148
Tags :
149
149
stage : !Ref Stage
150
150
project : !FindInMap [Constants, ProjectName, Value]
151
- namespace : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
151
+ namespace : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
152
152
153
+ # API GW Cloudwatch Log Group
153
154
UnicornContractsApiLogGroup :
154
155
Type : AWS::Logs::LogGroup
155
156
UpdateReplacePolicy : Delete
@@ -216,7 +217,7 @@ Resources:
216
217
- Key : project
217
218
Value : !FindInMap [Constants, ProjectName, Value]
218
219
- Key : namespace
219
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
220
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
220
221
221
222
# ### DEAD LETTER QUEUES
222
223
# DeadLetterQueue for UnicornContractsIngestQueue. Contains messages that failed to be processed
@@ -234,7 +235,7 @@ Resources:
234
235
- Key : project
235
236
Value : !FindInMap [Constants, ProjectName, Value]
236
237
- Key : namespace
237
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
238
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
238
239
239
240
# ### DYNAMODB TABLE
240
241
# Persist Contracts information in DynamoDB
@@ -258,7 +259,7 @@ Resources:
258
259
- Key : project
259
260
Value : !FindInMap [Constants, ProjectName, Value]
260
261
- Key : namespace
261
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
262
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
262
263
263
264
# ### EVENT BUS
264
265
# Event bus for Unicorn Contract Service used to publish and consume events
@@ -283,7 +284,7 @@ Resources:
283
284
Condition :
284
285
StringEquals :
285
286
events:source :
286
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
287
+ - " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
287
288
288
289
# Catchall rule used for development purposes.
289
290
UnicornContractsCatchAllRule :
@@ -296,9 +297,9 @@ Resources:
296
297
account :
297
298
- !Ref AWS::AccountId
298
299
source :
299
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
300
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornPropertiesNamespace}}"
301
- - !Sub " {{resolve:ssm:/uni-prop/${Stage} /UnicornWebNamespace}}"
300
+ - " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
301
+ - " {{resolve:ssm:/uni-prop/UnicornPropertiesNamespace}}"
302
+ - " {{resolve:ssm:/uni-prop/UnicornWebNamespace}}"
302
303
State : ENABLED # You may want to disable this rule in production
303
304
Targets :
304
305
- Arn : !GetAtt UnicornContractsCatchAllLogGroup.Arn
@@ -313,7 +314,7 @@ Resources:
313
314
LogGroupName : !Sub
314
315
- " /aws/events/${Stage}/${NS}-catchall"
315
316
- Stage : !Ref Stage
316
- NS : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
317
+ NS : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
317
318
RetentionInDays : !FindInMap
318
319
- LogsRetentionPeriodMap
319
320
- !Ref Stage
@@ -374,7 +375,7 @@ Resources:
374
375
Target : !GetAtt UnicornContractsEventBus.Arn
375
376
TargetParameters :
376
377
EventBridgeEventBusParameters :
377
- Source : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
378
+ Source : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
378
379
DetailType : ContractStatusChanged
379
380
InputTemplate : !ToJsonString
380
381
property_id : " <$.dynamodb.NewImage.property_id.S>"
@@ -430,12 +431,14 @@ Resources:
430
431
- Key : project
431
432
Value : !FindInMap [Constants, ProjectName, Value]
432
433
- Key : namespace
433
- Value : !Sub "{{resolve:ssm:/uni-prop/${Stage} /UnicornContractsNamespace}}"
434
+ Value : " {{resolve:ssm:/uni-prop/UnicornContractsNamespace}}"
434
435
435
436
# ### CLOUDFORMATION NESTED STACKS
436
437
# CloudFormation Stack with the Contracts Service Event Registry and Schemas
437
438
EventSchemasStack :
438
439
Type : AWS::Serverless::Application
440
+ UpdateReplacePolicy : Delete
441
+ DeletionPolicy : Delete
439
442
Properties :
440
443
Location : " integration/event-schemas.yaml"
441
444
Parameters :
@@ -444,6 +447,8 @@ Resources:
444
447
# CloudFormation Stack with the Cross-service EventBus policy for Contracts Service
445
448
SubscriberPoliciesStack :
446
449
Type : AWS::Serverless::Application
450
+ UpdateReplacePolicy : Delete
451
+ DeletionPolicy : Delete
447
452
DependsOn :
448
453
- UnicornContractsEventBusNameParam
449
454
Properties :
0 commit comments