Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in AWS by (5.6k points)

I'm working with a windows machine that needs to sync  to S3 so for that I tried the below code:

"C:\Program Files\amazon\AWSCLI\aws.exe" s3 sync components 

s3://test/MyTest/ --acl public-read --

cache-control "public, must-revalidate, proxy-revalidate, max-age=1800"

but getting error "Access Denied" while calling PutObject 

I'm providing the permission below:

"Sid": "VisualEditor4",

            "Effect": "Allow",

            "Action": [

                "s3:PutObject",

                "s3:PutObjectAcl"

            ],

            "Resource": 

1 Answer

0 votes
by (12.4k points)

Using PutObject is not going to sync S. For that, you need to some more actions, such as 'DerleteObject', 'GetBucketLOcation','GetObject','ListBucket', and 'PutObject' and after that use the below given policy:

{

    "Version": "2012-10-17",

    "Statement": [

        {

            "Resource": [

                "arn:aws:s3:::YOUR_BUCKET_NAME",

                "arn:aws:s3:::YOUR_BUCKET_NAME/*"

            ],

            "Sid": "Stmt1464826210000",

            "Effect": "Allow",

            "Action": [

                "s3:DeleteObject",

                "s3:GetBucketLocation",

                "s3:GetObject",

                "s3:ListBucket",

                "s3:PutObject"

            ]

        }

    ]

}

Looking forward to master AWS? Come & join AWS Certification by Intellipaat.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Dec 16, 2020 in AWS by devin (5.6k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...