import boto3
def getFileNameList(bucket_name, prefix):
s3 = boto3.resource('s3')
bucket=bucket_name
my_bucket = s3.Bucket(bucket)
path_list = []
for (bucket_name, key) in map(lambda x: (x.bucket_name, x.key), my_bucket.objects.filter(Prefix=prefix)):
path = "s3://{}/{}".format(bucket_name, key)
path_list.append(path)
return path_list
AWS-lambda函数中获取S3中某个文件夹下的所有文件的文件名
于 2022-11-14 09:12:01 首次发布