Home > database >  Why am I not seeing the contents of a localhost s3 bucket?
Why am I not seeing the contents of a localhost s3 bucket?

Time:11-05

Using localstack package I have the following:

awslocal s3 mb s3://kiosks-images
awslocal s3api put-bucket-acl --bucket kiosks-images --acl public-read
awslocal s3 cp TopCroppedSpotlightLowExOnlyPGV.jpg s3://kiosks-images/dev/us/2020_08_11/eea9efc9-5970-426b-b867-9f57d6d9548f/55208151-6438-4bfc-b4be-43ed57798dc2

aws s3 ls s3://kiosks-images
                           PRE dev/
                           PRE prod/
                           PRE qa/

how do I ensure the file I added is copied to a correct place in the bucket?

CodePudding user response:

By default, when you list objects in a bucket, S3 collapses any objects with the same prefix before the separator as one entry, and marks this collection as PRE in the output. This lets you treat the contents of S3 buckets as a traditional filesystem with directories and files in those directories.

You can either use aws s3 ls --recursive to list all objects in a bucket, or query the object directly by doing something like aws s3 ls s3://bucket-name/path/to/object to view that single object, if it exists.

  • Related