skip to Main Content

I am trying to create an s3 bucket using IAC (using CloudFormation and YAML Script) when I tried to create the stack it gave me this error "Property Status cannot be empty" I am not sure what it means and where things are going wrong. This is my first YAML script.

Resources:
 MyS3Profile:
    Type: AWS::S3::Bucket
    Properties:
      #AccelerateConfiguration: AccelerateConfiguration
      AccessControl: BucketOwnerFullControl
      BucketName: naa-jivitam
      #IntelligentTieringConfigurations: []
      #InventoryConfigurations: []
      LifecycleConfiguration:
        Rules:
          - Transition: 
                StorageClass: GLACIER
                TransitionInDays: 25
      LoggingConfiguration: 
        DestinationBucketName: naa-jivitam
        LogFilePrefix: my-s3-logs/
      MetricsConfigurations: 
        - Id: MyMetricsConfiguration
          Prefix: MetricLogs/
      OwnershipControls: 
        Rules:
          - ObjectOwnership: BucketOwnerEnforced
      PublicAccessBlockConfiguration: 
        BlockPublicAcls: true
        IgnorePublicAcls: true
        BlockPublicPolicy: true
        RestrictPublicBuckets: true
      VersioningConfiguration: 
        Status: Enabled
      WebsiteConfiguration: 
        IndexDocument: covidform/covid_form/templates/index.html

2

Answers


  1. Under LifecycleConfiguration, add a Status parameter.

    Resources:
     TestBucket:
     Type: AWS::S3::Bucket
     Properties:
       BucketName: !Sub "${AWS::StackName}-test"
       AccessControl: Private
       LifecycleConfiguration:
        Rules:
          Status: Enabled
    
    Login or Signup to reply.
  2. This is syntax error problem

    According to Docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-rule.html

    Status is a required field

    Status
    If Enabled, the rule is currently being applied. If Disabled, the rule is not currently being applied.
    
    Required: Yes
    
    Type: String
    
    Allowed values: Disabled | Enabled
    
    Update requires: No interruption
    

    It’s always a good idea to check the syntax for cloudformation syntax.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search