Getting this error trying to create a static web site.
Error: Error putting S3 policy: MalformedPolicy: Missing required field Principal cannot be empty!
status code: 400, request id: [redacted], host id: [redacted]
with module.mainsite.module.main_static_site.module.s3_logs_bucket.aws_s3_bucket_policy.logs_access_policy,
on .terraform/modules/mainsite.main_static_site.s3_logs_bucket/main.tf line 70, in resource "aws_s3_bucket_policy" "logs_access_policy":
70: resource "aws_s3_bucket_policy" "logs_access_policy" {
module "main_static_site" {
source = "cn-terraform/s3-static-website/aws"
version = "0.0.17"
name_prefix=var.deployment_name
website_domain_name=var.main_site_domain_name
create_route53_hosted_zone = false
route53_hosted_zone_id = aws_route53_zone.main.zone_id
providers = {
aws.main = aws
aws.acm_provider = aws
}
}
Where the following applies:
* var.main_deployment_name = "production"
* var.main_site_domain_name = "mydomain.com"
I'm creating a hosted zone manually and passing it in.
The line in the associated module shows this on line 70:
```hcl
resource "aws_s3_bucket_policy" "logs_access_policy" {
bucket = aws_s3_bucket.logs.id
policy = data.aws_iam_policy_document.logs_access_policy_document.json
}
I'm not sure which field is missing, but this is the result from AWS. Is there a known workaround for this?