mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 13:44:24 +00:00
chore(kb/awscli): add or improve command examples
This commit is contained in:
@@ -63,21 +63,6 @@ aws s3 sync '.' 's3://arn:aws:s3:us-west-2:123456789012:accesspoint/myaccesspoin
|
||||
# Delete buckets.
|
||||
aws s3 rb 's3://my-bucket'
|
||||
aws s3 rb 's3://my-bucket' --force
|
||||
|
||||
|
||||
# Lifecycle configurations.
|
||||
aws s3api get-bucket-lifecycle-configuration --bucket 'bucketName'
|
||||
aws s3api put-bucket-lifecycle-configuration --bucket 'bucketName' \
|
||||
--lifecycle-configuration 'file://lifecycle.definition.json'
|
||||
aws s3api delete-bucket-lifecycle-configuration --bucket 'bucketName'
|
||||
|
||||
|
||||
# Show tags on objects.
|
||||
aws s3api list-objects-v2 \
|
||||
--bucket 'my-bucket' --prefix 'someObjectsInHereAreTagged' \
|
||||
--query 'Contents[*].Key' --output text \
|
||||
| xargs -n 1 \
|
||||
aws s3api get-object-tagging --bucket 'my-bucket' --query 'TagSet[*]' --key
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -87,10 +72,29 @@ aws s3api list-objects-v2 \
|
||||
|
||||
```sh
|
||||
# Manage lifecycle configurations.
|
||||
aws s3 get-bucket-lifecycle-configuration --bucket 'batman'
|
||||
aws s3 put-bucket-lifecycle-configuration --bucket 'batman' \
|
||||
--lifecycle-configuration 'file://lifecycle-batman.json'
|
||||
aws s3 delete-bucket-lifecycle --bucket 'batman'
|
||||
# Operations on lifecycle rules take a while.
|
||||
aws s3api get-bucket-lifecycle-configuration --bucket 'bucketName'
|
||||
aws s3api put-bucket-lifecycle-configuration --bucket 'bucketName' \
|
||||
--lifecycle-configuration 'file://lifecycle.definition.json'
|
||||
aws s3api delete-bucket-lifecycle-configuration --bucket 'bucketName'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Real life use cases</summary>
|
||||
|
||||
```sh
|
||||
# Get objects with their storage class.
|
||||
aws s3api list-objects --bucket 'my-bucket' \
|
||||
--query 'Contents[].{Key: Key, StorageClass: StorageClass}'
|
||||
|
||||
# Show tags on objects.
|
||||
aws s3api list-objects-v2 \
|
||||
--bucket 'my-bucket' --prefix 'someObjectsInHereAreTagged' \
|
||||
--query 'Contents[*].Key' --output text \
|
||||
| xargs -n 1 \
|
||||
aws s3api get-object-tagging --bucket 'my-bucket' --query 'TagSet[*]' --key
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user