환경
설치 방법
install
$ sudo ./install
[sudo] password for woo:
Running cmd: /usr/bin/python virtualenv.py --no-download --python /usr/bin/python /home/woo/.local/lib
Running cmd: /home/woo/.local/lib/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --fi://. setuptools_scm-3.3.3.tar.gz
Running cmd: /home/woo/.local/lib/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --fi://. wheel-0.33.6.tar.gz
Running cmd: /home/woo/.local/lib/aws/bin/pip install --no-binary :all: --no-build-isolation --no-cachdex --find-links file:///home/woo/storage/awscli-bundle/packages awscli-1.20.24.tar.gz
You can now run: /home/woo/.local/lib/aws/bin/aws --version
Note: AWS CLI version 2, the latest major version of the AWS CLI, is now stable and recommended for genemore information, see the AWS CLI version 2 installation instructions at: https://docs.aws.amazon.com/clguide/install-cliv2.html
$ aws configure --profile woo
AWS Access Key ID [None]: -- access key --
AWS Secret Access Key [None]: -- secret key --
Default region name [None]: -- region name --
Default output format [None]: json
-- 확인 --
$ cat .aws/config
[profile woo]
region = -- region name --
output = json
$ cat .aws/credentials
[woo]
aws_access_key_id = -- access key --
aws_secret_access_key = -- secret key --
## Get Bucket List
$ aws s3api --endpoint=http://xxx.xxx.xxx.xxx:8080 list-buckets --profile woo
{
"Buckets": [
{
"Name": "test-bucket",
"CreationDate": "1970-01-01T00:00:00Z"
}
],
"Owner": {
"DisplayName": "s3obj",
"ID": "1101"
}
}
### Upload Object
$ aws s3api --endpoint=http://xxx.xxx.xxx.xxx:8080 put-object --profile woo --bucket test-bucket --key "cifar10-2.tar" --body "cifar10-2.tar"
{
"ETag": "\"e74c4ade88ab2727f0eb073892f5b21c\""
}
### Download Object
$ aws s3api --endpoint=http://xxx.xxx.xxx.xxx:8080 get-object --profile woo --bucket test-bucket --key "cifar10-2.tar" /home/woo/cifar10-2.tar
{
"LastModified": "Tue, 17 Aug 2021 00:53:07 GMT",
"ContentLength": 10240,
"ETag": "\"e74c4ade88ab2727f0eb073892f5b21c\"",
"VersionId": "null",
"ContentType": "application/octet-stream",
"Metadata": {
"sha256": "7b2e9eb7963aa11c6462fe74617d5ebbad45f2163ac0fba073c01971f3ba5bf1",
"s3b-last-modified": "20210610T020018Z"
}
}
## Get Object list
$ aws s3api --endpoint=http://xxx.xxx.xxx.xxx:8080 list-objects --profile woo --bucket test-bucket
{
"Contents": [
{
"Key": "cifar10-2.tar",
"LastModified": "2021-08-19T08:30:42Z",
"ETag": "\"e74c4ade88ab2727f0eb073892f5b21c\"",
"Size": 10240,
"StorageClass": "STANDARD",
"Owner": {
"DisplayName": "s3obj",
"ID": "1101"
}
}
]
}