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
asked 3 months ago613 views
3 Answers
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
answered 2 months ago
  • 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
Accepted Answer

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
EXPERT
answered 3 months ago
  • 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
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions