To upload file to s3 you need:
- Install AWS CLI
- Configure AWS API access credentials (KEY and SECRET)
- Run
aws s3 cp
command - Generate presign URL with
aws s3 presign
to get url for secure share (access expires after some time)
Install AWS CLI with pip, in terminal run:
pip install --upgrade --user awscli
You need python on Linux, or you can use python in
cygwin
on Windows)
Now we need configure access to AWS account:
./local/bin/aws configure
Enter your credentials from AWS Web console
To get credentials I recommend create a new user in
AWS Console
->IAM
, use Programmatic access only user, withS3FullAccess
policy
Create a new bucket (name must be unique):
aws s3api create-bucket --bucket bucketname
Upload some file.zip
:
./local/bin/aws s3 cp /path/to/file.zip s3://bucketname/
Generate URL for 100 hours (means that it will expire after 100
hours):
~/.local/bin/aws s3 presign s3://bucketname/file.zip --expires-in 360000
To list files inside of yoor bucket use s3 ls
:
./local/bin/aws s3 ls s3://bucketname/