// Array of all keys in s3 bucket
const findKeys = async(bucketName)=>{
const {Contents} = await s3.listObjects({Bucket: bucketName}).promise()
const keysArr = []
for(const obj of Contents){
keysArr.push(obj.Key)
}
return keysArr
}
def get_s3_keys(bucket):
"""Get a list of keys in an S3 bucket."""
keys = []
resp = s3.list_objects_v2(Bucket=bucket)
for obj in resp['Contents']:
keys.append(obj['Key'])
return keys