diff --git a/templates/prod_homepage.yml b/templates/prod_homepage.yml index b60302e..32a7ea8 100644 --- a/templates/prod_homepage.yml +++ b/templates/prod_homepage.yml @@ -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 ] @@ -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