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
Under LifecycleConfiguration, add a Status parameter.
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
It’s always a good idea to check the syntax for cloudformation syntax.