10

I'm trying to set a Life cycle configuration for my S3 buckets to expire after 90 days. However, I'm getting an error saying "Property Status cannot be empty" when pushing my CFT stack.

I tried setting a lifestyle config, and putting the expiration in days onto that, but it seems to be failing.

AWSTemplateFormatVersion: '2010-09-09'
Description: Creates S3 Bucket

Resources:
 TestBucket:
 Type: AWS::S3::Bucket
 Properties:
   BucketName: !Sub "${AWS::StackName}-test"
   AccessControl: Private
   LifecycleConfiguration:
    Rules:
    - Id: DeleteContentAfter90Days
      Prefix: ''
      Status: Enabled
      ExpirationInDays: '90'

I'm getting "Property status cannot be empty" and an update rollback when I check my status in the console.

BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
Mohan Aravind
  • 111
  • 2
  • 2
  • 5

3 Answers3

16
Status: 'Enabled'

Status should be string value as stated in the documentation

Here is a working example of LifecycleConfiguration:

LifecycleConfiguration:
    Rules:
      - Id: DeleteContentAfter1Day
        Status: 'Enabled'
        ExpirationInDays: 1
BDL
  • 21,052
  • 22
  • 49
  • 55
Efi gazarov
  • 171
  • 2
  • 7
5

ExpirationInDays should be a number, not a string

2

Cloudformation can't take null values, remove this line - Prefix: ''

tjay
  • 21
  • 1