Transfer Data from EC2 to S3

0

I plan on deleting/deactivating my instances of EC2, but before I do so, I want to transfer all my existing data from EC2 to S3 so I have a copy for permanent storage. How do I do this?

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

Assuming you have the data in an EBS, you could do this via DataSync.

Since it is currently not possible to transfer via DataSync from an EBS you need an NFS server to share the data directories with a DataSync agent. You can install an NFS server on your EC2 instance or create a snapshot of it, then create a volume from the snapshot and attach it to an instance that will act as an NFS server.

Once you have the NFS, follow the necessary steps in DataSync:

  • create an agent.
  • create a source location which is the NFS and a destination location which is your S3 bucket.
  • create a copy task and launch it.
Imobach
답변함 2년 전

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

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

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