diff --git a/AWS-CLI-with-SeaweedFS.md b/AWS-CLI-with-SeaweedFS.md new file mode 100644 index 0000000..6032912 --- /dev/null +++ b/AWS-CLI-with-SeaweedFS.md @@ -0,0 +1,48 @@ +### Installation +See https://aws.amazon.com/cli/ + +On mac or linux: `pip install awscli` + +### Configuration +Configure for AWS. The key values do not matter. +``` +$ aws configure +AWS Access Key ID [None]: any +AWS Secret Access Key [None]: any +Default region name [None]: us-east-1 +Default output format [None]: +``` + +Also, make sure using AWS signature version 4: +``` +$ aws configure set default.s3.signature_version s3v4 + +``` + +### Execute commands +``` +# list buckets +$ aws --endpoint-url http://localhost:8333 s3 ls +2019-01-02 01:59:25 newbucket + +# list files inside the bucket +$ aws --endpoint-url http://localhost:8333 s3 ls s3://newbucket +2019-01-02 12:52:44 6804 password + +# make a bucket +$ aws --endpoint-url http://localhost:8333 s3 mb s3://newbucket3 +make_bucket: newbucket3 + +# add an object +$ aws --endpoint-url http://localhost:8333 s3 cp /etc/passwd s3://newbucket3 +upload: ../../../../../etc/passwd to s3://newbucket3/passwd + +# remove an object +$ aws --endpoint-url http://localhost:8333 s3 rm s3://newbucket3/passd +delete: s3://newbucket3/passd + +# remove a bucket +$ aws --endpoint-url http://localhost:8333 s3 rb s3://newbucket3 +remove_bucket: newbucket3 + +``` \ No newline at end of file