Skip to content

Commit

Permalink
Merge pull request #53 from rrigato/dev
Browse files Browse the repository at this point in the history
automatically expire cloudfront logs
  • Loading branch information
rrigato authored May 18, 2024
2 parents e43881a + a3f863d commit 4025251
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions templates/prod_homepage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ Parameters:
Default: Z2FDTNDATAQYW2
Description: Route 53 Hosted Zone id

LogFileExpirationInDays:
Type: Number
Default: 90

ProjectName:
Type: String
Default: homepage




Conditions:
RetainResourcesCreated:
!Equals [ !Ref BucketName, ryanrigato.com ]
Expand All @@ -36,6 +38,14 @@ Resources:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub '${ProjectName}-logging'
LifecycleConfiguration:
Rules:
- Id: LogFileExpirationRule
Status: Enabled
ExpirationInDays: !Ref LogFileExpirationInDays
NoncurrentVersionExpirationInDays: !Ref LogFileExpirationInDays
AbortIncompleteMultipartUpload:
DaysAfterInitiation: !Ref LogFileExpirationInDays
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerPreferred
Expand Down

0 comments on commit 4025251

Please sign in to comment.