ConsultUtah
ConsultUtah

Reputation: 6809

List S3 contents by the owner

Is it possible to list the contents of an S3 bucket for a particular owner? I have a very large number of files with the wrong owner and need to update them to the correct owner in the most efficient way possible.

Thx

Upvotes: 1

Views: 1334

Answers (1)

Dunedan
Dunedan

Reputation: 8435

Of course you can. E.g. with the following AWS CLI command:

aws s3api list-objects-v2 --bucket your-bucket --fetch-owner \
                          --query "Contents[?Owner.ID=='your-owner']"

Upvotes: 5

Related Questions