question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Step 5: An error occurred (MalformedPolicy) when calling the PutBucketPolicy operation: Policy has invalid resource

See original GitHub issue
screen shot 2018-10-22 at 3 06 54 pm

bucketpolicy.json:

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddPerm",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::barton-travel-site/*"]
    }
  ]
}

Command: aws s3api put-bucket-policy --bucket barton-travel-site --policy file://bucketpolicy.json

Output:

An error occurred (MalformedPolicy) when calling the PutBucketPolicy operation: Policy has invalid resource

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
mamonalsalihycommented, Jun 9, 2020

I fixed this error by saving the website-bucket-policy.json file unsaved saved

3reactions
lnryancommented, Jan 14, 2020

How can this be resolved via the aws cli?

Read more comments on GitHub >

github_iconTop Results From Across the Web

An error occurred (MalformedPolicy) when calling the ...
This error you're receiving indicates that the bucket you're attaching this policy does not share the same name. In other words your resource...
Read more >
Error putting S3 policy: MalformedPolicy: Invalid policy syntax ...
I am able to create the s3 bucket successfully. But when I try to provision the s3 bucket policy it throws error.
Read more >
Tutorial: Configuring a static website on Amazon S3
A message appears indicating that the bucket policy has been successfully added. If you see an error that says Policy has invalid resource...
Read more >
invalid resource on a bucket policy : r/aws - Reddit
im trying to set a bucket policy so that I can copy all contents of a ... generator but i still get the...
Read more >
Cross Account Resource Access - Invalid Principal in Policy
It is a rather simple architecture. A Lambda function from account A called Invoker Function needs to trigger a function in account B...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found