Skip to content

Commit

Permalink
feat: set retention period for the Log group
Browse files Browse the repository at this point in the history
  • Loading branch information
miztch committed Jul 9, 2024
1 parent 7e4b128 commit 461c109
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Parameters:
Route53HostedZoneId:
Description: Route53 hostzone id for the APIDomainName
Type: String
# DaysToRetainLogs:
# Description: days to retain logs in CloudWatch
# Type: Number
# Default: 30
DaysToRetainLogs:
Description: days to retain logs in CloudWatch
Type: Number
Default: 30

Resources:
RestAPI:
Expand Down Expand Up @@ -82,6 +82,7 @@ Resources:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${Function}
RetentionInDays: !Ref DaysToRetainLogs

Outputs:
FunctionArn:
Expand Down

0 comments on commit 461c109

Please sign in to comment.