File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # aws s3api
2+
3+ > Create and delete Amazon S3 buckets and edit bucket properties.
4+ > More information: < https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/index.html > .
5+
6+ - Create a bucket:
7+
8+ ` aws s3api create-bucket --bucket {{bucket_name}} `
9+
10+ - Delete a bucket:
11+
12+ ` aws s3api delete-bucket --bucket {{bucket_name}} `
13+
14+ - List buckets:
15+
16+ ` aws s3api list-buckets `
17+
18+ - List the objects inside of a bucket and only show each object's key and size:
19+
20+ ` aws s3api list-objects --bucket {{bucket_name}} --query '{{Contents[].{Key: Key, Size: Size}}}' `
21+
22+ - Add an object to a bucket:
23+
24+ ` aws s3api put-object --bucket {{bucket_name}} --key {{object_key}} --body {{path/to/file}} `
25+
26+ - Download object from a bucket (The output file is always the last argument):
27+
28+ ` aws s3api get-object --bucket {{bucket_name}} --key {{object_key}} {{path/to/output_file}} `
29+
30+ - Apply an Amazon S3 bucket policy to a specified bucket:
31+
32+ ` aws s3api put-bucket-policy --bucket {{bucket_name}} --policy file://{{path/to/bucket_policy.json}} `
33+
34+ - Download the Amazon S3 bucket policy from a specified bucket:
35+
36+ ` aws s3api get-bucket-policy --bucket {{bucket_name}} --query Policy --output {{json|table|text|yaml|yaml-stream}} > {{path/to/bucket_policy}} `
You can’t perform that action at this time.
0 commit comments