Error: error reading S3 Bucket Logging: empty output

Hi,

I got an error when applying for creating an S3 bucket with logging enabled. Terraform apply gave the error
Error: error reading S3 Bucket Logging: empty output

I could not figure out what is the error from the message. Need some help. Thanks.

Hey Libra! Can you provide your syntax?

Make sure to use the aws_s3_bucket_logging resource. See below!

resource "aws_s3_bucket_logging" "log_test" {
    bucket = aws_s3_bucket.test-bucket10002000.id
    
    target_bucket = aws_s3_bucket.log-bucket10002000.id
    target_prefix = "log/"
  
}