I try to follow next tutorial: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-bucket-policy.html but got an "Unknown error" Missing required field principal:
Json:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListObjectsV2",
"s3:ListObjects"
],
"Resource": "arn:aws:s3:::awesome-proj/*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "s3:GetBucketLocation",
"Resource": "arn:aws:s3:::awesome-proj"
}
]
}
I generated a policy but have the same result:
I updated Resource and Principal values - :
{
"Id": "Policy1608869326556",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1608869322454",
"Action": [
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::awesome-proj/*",
"Principal": "*"
}
]
}
As a result, I have the error Action does not apply to any resource(s) in statement now.
How to correctly create an s3-bucket policy?


ec2-userfor bucket policies. What do you want to achieve? Access bucket from an ec2 instance? - Marcin