- Newest
- Most votes
- Most comments
Hello,
To resolve the "Fix all syntax errors to view this panel" error when editing your S3 bucket policy, follow these steps:
Replace the Existing Policy: Overwrite the current policy with the new one instead of appending it. Ensure the syntax and structure of the policy are correct.
Combine Policies: If you need to retain both policies, combine them into a single policy with multiple statements. Here's an example:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "logging.s3.amazonaws.com"
},
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::example-s3-1/*",
"arn:aws:s3:::example-s3-2/*"
],
"Condition": {
"StringEquals": {
"aws:SourceAccount": "11111111111111"
}
}
},
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}
Hello.
Please overwrite the existing bucket policy.
If the ARN of the S3 bucket listed in the statement section is different, please list the resources and enter multiple ARNs.
The bucket policy below is an example, but if you list the resource section, it will look like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "logging.s3.amazonaws.com"
},
"Action": [
"s3:PutObject"
],
"Resource": ["arn:aws:s3:::example-s3-1/*","arn:aws:s3:::example-s3-2/*"],
"Condition": {
"StringEquals": {
"aws:SoruceAccount": "11111111111111"
}
}
}
]
}
I replaced the original policy and the error has gone. I hope I didn't need the original one. Thanks for your help everyone.
Relevant content
- asked 3 years ago
- asked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago