AWS CLI's S3 wildcard support is a bit primitive, but you could use multiple --exclude
options to accomplish this. Note: the order of includes
and excludes
is important.
aws s3 cp --dryrun . s3://mybucket --recursive --exclude "*" --include "*.jpg" --exclude "*/*"