AWS S3 bucket policy for Get object error in the policy generator Json code

0 votes
The below code was generated by using the S3 policy generator. when I paste the code into the AWS S3 edit policy console it shows an error.

{
  "Id": "Policy1611491895768",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1611491893687",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::aws-landing-zone-configuration-756692330110-ap-south-1",
      "Principal": {
        "AWS": [
          "\"AWS\": \"arn:aws:iam::756692330110::user/aravindkumar.s@gmail.com\""
        ]
      }
    }
  ]
}

How do I overcome this error?
Apr 11, 2022 in Others by Kichu
• 19,040 points
904 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
The issue is that GetObject is applicable only to bucket objects, not the bucket. To solve this make sure that  Resources should contain   /* at the end.
There is one more issue on your side that needs to be fixed. That is your Principle is not formatted right.
Updated policy:

  {
    "Version": "2012-10-17",
    "Id": "Policy1611491895768",
    "Statement": [
        {
            "Sid": "Stmt1611491893687",
            "Effect": "Allow",
            "Principal": {
                "AWS": ["arn:aws:iam::756692330110:user/aravindkumar.s@gmail.com"]
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::aws-landing-zone-configuration-756692330110-ap-south-1/*"
        }
    ]
  }

I hope this helps you.
answered Apr 12, 2022 by narikkadan
• 63,600 points

edited Mar 5

Related Questions In Others

0 votes
1 answer

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

Over two years has passed, now and ...READ MORE

answered Feb 11, 2022 in Others by Soham
• 9,710 points
3,315 views
0 votes
1 answer

Get last modified object from S3 using AWS CLI

Try this command $ aws s3api list-objects --bucket ...READ MORE

answered Sep 20, 2022 in Others by anonymous

edited Mar 5 5,083 views
0 votes
0 answers
0 votes
0 answers

How to change storage class of object in s3 bucket?

How can I change the storage class ...READ MORE

Apr 11, 2022 in Others by Kichu
• 19,040 points
1,376 views
0 votes
1 answer

What is the character code for new line break in excel

Use CHAR(10) and Turn on Wrap Text option. It ...READ MORE

answered Dec 27, 2022 in Others by narikkadan
• 63,600 points
782 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
6,264 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,411 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
3,004 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP