Build a Serverless Web Application - Errors on copying S3 file Wildrydes

2

Hi Experts,

We have been trying to do the hands-on tutorial Building a Serverless WebApp. However, we are stuck in the Module 1 as we encountered error while running the command:

aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive

fatal error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

We have tried resolving the issues as suggested in the post https://repost.aws/knowledge-center/s3-access-denied-listobjects-sync# and various blog as well. But problem persists.

If the S3 bucket still accessible to the public? If yes, can you help advice what needs to be done on our end to be able to access bucket?

Thanks in advance for the help.

BR,

Ian

Bonchon
已提問 3 個月前檢視次數 715 次
3 個答案
4

There are 2 problems.

  • IAM user needs to be allowed AmazonS3ReadOnlyAccess. Add the "AmazonS3ReadOnlyAccess" to your IAM user.
  • For some reason, it seems that AWS revoked public access to s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website. Hence, we need to get the tutorial contents from unofficial alternatives: eg) s3://ttt-wildrydes/wildrydes-site
profile picture
Karl
已回答 3 個月前
  • There is the other version of official tutorial:

    https://webapp.serverlessworkshops.io/1-staticwebhosting/3-repository/

    In this tutorial, the tutorial contents will be cloned from github.

  • Hi Karl,

    Thank you. We were able to continue on the AWS Serverless App exercise using the s3://ttt-wildrydes/wildrydes-site.

    Thank and BR,

    Ian

  • It seems like s3://ttt-wildrydes/wildrydes-site has a copy of a .git directory. Take care of downloading the files in another path delete the .git directory and then copy the files to your local repo.

1
已接受的答案

Hello.

Are you running the AWS CLI on a local PC or something?
In that case, please check whether the access key created from the IAM user is set correctly.
https://docs.aws.amazon.com/cli/latest/userguide/cli-authentication-user.html

If you are using IAM Identity Center, you can also set it by following the steps in the document below.
https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html

Also, check if the IAM policy used by the IAM user allows "s3:ListBucket" to S3.
Also, check if "s3:ListBucket" is allowed in the bucket policy of the target S3 bucket.

profile picture
專家
已回答 3 個月前
  • HI Riku,

    Thank you for the feedback. We are running the AWS CLI on a local PC (Mac). We have configure the CLI by creating a user in IAM and configuring the CLI using the user credential.

    We have also added S3: ListBucket permission to user. See below: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "*" } ] }

    However, it still did not work.

    My guess is that the bucket policy of the target S3 bucket does not allow access (although in the tutorial it was mentioned publicly available). However, we don't know who is account owner for the S3 bucket to request to allow.

    Thank and BR,

    ian

0

same porblem! I should have copied the project locally, then copied it to my s3 and then added it to the CodeCommit project.

sofiane
已回答 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南