S3

bucket間でのコピー

aws s3 sync s3://example/dir1/ s3://example/ --profile example

objectのタイムゾーンを表示する

要望は上がっている


aws s3 lsでバケット作成日がregion指定で異なる値を返す


keyの部分一致したobjectを抽出

aws s3api list-objects-v2 --bucket <bucket> --query "Contents[?contains(Key, '<key name>')]" --profile <profile>

ls: key名だけの取得


object数と合計ファイルサイズ


署名付オブジェクトURLの有効期限


署名付きオブジェクトURLの生成


S3 cp: ワイルドカードを使う


S3 sync

aws s3 sync s3://mybucket/ ./ --exclude "*" --include "test01/*" --include "test02/*"

S3のbucket policy取得

AWS_PROFILE=default
for bucket in $(aws --profile $AWS_PROFILE s3api list-buckets --query "Buckets[].[Name]" --output text); do \
region=$(aws --profile $AWS_PROFILE s3api get-bucket-location --bucket $bucket --output text); \
echo "---- $bucket"; \
aws --profile $AWS_PROFILE --region $region s3api get-bucket-policy --bucket $bucket; \
done > $AWS_PROFILE.s3.bucket-policy.json

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-07-07 (木) 11:12:27