Skip to content

Commit 5645e35

Browse files
committed
chore: update visibility timeout and add deletion policies in templates
1 parent 7bf21ed commit 5645e35

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

unicorn_contracts/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Resources:
204204
RedrivePolicy:
205205
deadLetterTargetArn: !GetAtt UnicornContractsIngestDLQ.Arn
206206
maxReceiveCount: 1
207-
VisibilityTimeout: 40
207+
VisibilityTimeout: 20
208208
Tags:
209209
- Key: stage
210210
Value: !Ref Stage

unicorn_properties/template.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,17 @@ Resources:
7272
# Services share their event bus name and arn
7373
UnicornPropertiesEventBusNameParam:
7474
Type: AWS::SSM::Parameter
75+
DeletionPolicy: Delete
76+
UpdateReplacePolicy: Delete
7577
Properties:
7678
Type: String
7779
Name: !Sub /uni-prop/${Stage}/UnicornPropertiesEventBus
7880
Value: !GetAtt UnicornPropertiesEventBus.Name
7981

8082
UnicornPropertiesEventBusArnParam:
8183
Type: AWS::SSM::Parameter
84+
DeletionPolicy: Delete
85+
UpdateReplacePolicy: Delete
8286
Properties:
8387
Type: String
8488
Name: !Sub /uni-prop/${Stage}/UnicornPropertiesEventBusArn
@@ -196,6 +200,8 @@ Resources:
196200
#### STATE MACHINE
197201
ApprovalStateMachine:
198202
Type: AWS::Serverless::StateMachine
203+
DeletionPolicy: Delete
204+
UpdateReplacePolicy: Delete
199205
Properties:
200206
Name: !Sub "${AWS::StackName}-ApprovalStateMachine"
201207
DefinitionUri: state_machine/property_approval.asl.yaml
@@ -251,7 +257,7 @@ Resources:
251257
Destination: !GetAtt PropertiesServiceDLQ.Arn
252258
DefinitionSubstitutions:
253259
WaitForContractApprovalArn: !GetAtt WaitForContractApprovalFunction.Arn
254-
TableName: !Ref ContractStatusTable
260+
TableName: !Ref ContractStatusTable
255261
ImageUploadBucketName: !Sub "{{resolve:ssm:/uni-prop/${Stage}/ImagesBucket}}"
256262
EventBusName: !GetAtt UnicornPropertiesEventBus.Name
257263
ServiceName: "{{resolve:ssm:/uni-prop/UnicornPropertiesNamespace}}"
@@ -315,7 +321,7 @@ Resources:
315321
BillingMode: PAY_PER_REQUEST
316322
Tags:
317323
- Key: project
318-
Value: !FindInMap [ Constants, ProjectName, Value ]
324+
Value: !FindInMap [Constants, ProjectName, Value]
319325
- Key: namespace
320326
Value: "{{resolve:ssm:/uni-prop/UnicornPropertiesNamespace}}"
321327
- Key: stage
@@ -325,12 +331,16 @@ Resources:
325331
# Event bus for Unicorn Properties Service, used to publish and consume events
326332
UnicornPropertiesEventBus:
327333
Type: AWS::Events::EventBus
334+
DeletionPolicy: Delete
335+
UpdateReplacePolicy: Delete
328336
Properties:
329337
Name: !Sub UnicornPropertiesBus-${Stage}
330338

331339
# Event bus policy to restrict who can publish events (should only be services from UnicornPropertiesNamespace)
332340
UnicornPropertiesEventsBusPublishPolicy:
333341
Type: AWS::Events::EventBusPolicy
342+
DeletionPolicy: Delete
343+
UpdateReplacePolicy: Delete
334344
Properties:
335345
EventBusName: !Ref UnicornPropertiesEventBus
336346
StatementId: !Sub OnlyPropertiesServiceCanPublishToEventBus-${Stage}
@@ -349,6 +359,8 @@ Resources:
349359
# Catchall rule used for development purposes. Logs all events matching any of the services to CloudWatch Logs
350360
UnicornPropertiesCatchAllRule:
351361
Type: AWS::Events::Rule
362+
DeletionPolicy: Delete
363+
UpdateReplacePolicy: Delete
352364
Properties:
353365
Name: properties.catchall
354366
Description: Catchall rule used for development purposes.

unicorn_shared/uni-prop-images.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Parameters:
2222
Globals:
2323
Function:
2424
Timeout: 15
25-
Runtime: python3.11
25+
Runtime: python3.12
2626
MemorySize: 512
2727
Tracing: Active
2828
Architectures:
@@ -55,7 +55,7 @@ Resources:
5555
Type: AWS::Serverless::Function
5656
Properties:
5757
Handler: index.lambda_handler
58-
Runtime: python3.11
58+
Runtime: python3.13
5959
Policies:
6060
- S3CrudPolicy:
6161
BucketName: !Ref UnicornPropertiesImagesBucket

unicorn_web/template.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Metadata:
1414
- ES6000 # Rule disabled because SQS DLQs don't need a RedrivePolicy
1515
- WS2001 # Rule disabled because check does not support !ToJsonString transform
1616
- ES1001 # Rule disabled because our Lambda functions don't need DestinationConfig.OnFailure
17+
- W3002 # Rule disabled as nested templates are being packaged
1718
- W3002 # Rule disabled as nested templates are being packaged
1819
- E3030 # Rule disabled due to using cfn-lint-serverless rules v0.3
1920

@@ -182,10 +183,7 @@ Resources:
182183
- MetricsEnabled: true
183184
ResourcePath: /*
184185
HttpMethod: "*"
185-
LoggingLevel: !If
186-
- IsProd
187-
- ERROR
188-
- INFO
186+
LoggingLevel: !If [IsProd, ERROR, INFO]
189187
ThrottlingBurstLimit: 10
190188
ThrottlingRateLimit: 100
191189
AccessLogSetting:
@@ -452,7 +450,7 @@ Outputs:
452450
BaseUrl:
453451
Description: Web service API endpoint
454452
Value: !Sub "https://${UnicornWebApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}"
455-
UnicornWebRestApiUrl:
453+
UnicornWebApiUrl:
456454
Description: Web service API endpoint
457455
Value: !Sub "https://${UnicornWebApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${Stage}/"
458456

0 commit comments

Comments
 (0)