Move files from S3 Bucket back to Site

0

How can I move all the files in my S3 Bucket back onto the website itself in anticipation of deleting the bucket and simply keeping the files on the site itself? Luddite here....

jess888
질문됨 2년 전280회 조회
2개 답변
2
  1. Create a role for EC2 with a policy including GetObject to the objects in the bucket. The policy looks like this:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1647624289157",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::mybucket/*"
    }
  ]
}
  1. Assign the role to the webserver.
  2. On the webserver, copy the files:
aws s3 cp s3://mybucket . --recursive
  1. Remove role from webserver & delete the role and policy
profile pictureAWS
전문가
kentrad
답변함 2년 전
0

It depends on your website software, and how does it treat the files

As a general answer, you can download all bucket objects using the CLI with the command aws s3 sync and adecuate access credentials Once in your site's disk you'll have work ahead, for sure

theist
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠