2 回答
- 最新
- 投票最多
- 评论最多
2
- 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/*"
}
]
}
- Assign the role to the webserver.
- On the webserver, copy the files:
aws s3 cp s3://mybucket . --recursive
- Remove role from webserver & delete the role and policy