Saturday, October 29, 2022

[SOLVED] How to upload a file from local to S3 bucket using EC2 linux machine?

Issue

How can I upload a file from my local system to AWS S3 bucket using EC2 Linux machine? How can I use aws s3 cp command here?

I've tried aws s3 cp <fileName> s3://<BucketName>, but the above command works if the file is in the linux machine.


Solution

It sounds like 2 steps are required here.

  1. Transfer files from your local drive to the EC2 instance.
  • You can transfer the files with something like SCP, S3 isn't in the picture here.
  1. Upload the files from EC2 to S3.
  • You can use the cli here, similar to the command you already posted.

On which step are you stuck here exactly?



Answered By - Christoph Fischer
Answer Checked By - Pedro (WPSolving Volunteer)