Uses the x-amz-website-redirect-location to set bulk redirects for a given S3 bucket. Routing rules have a max limit whereas this does not.
Given a CSV file with the from
and to
redirect values comma separated (no header), it'll create S3 objects with the appropriate metadata so that they redirect properly when hitting those routes.
npm install --save-dev s3-bulk-redirector
s3-bulk-redirector -c CSV_FILE -b BUCKET
If you use a named AWS Profile, prefix the command with AWS_PROFILE=X.
Options:
-c
CSV file withfrom
andto
values to redirect. Required-b
S3 Bucket to add the redirects objects to. Required-p
Flag to set S3 Object ACL as private instead of public
/foo/,/bar/
/one,/two/place
Use node version of 18+.
npm install
- Run:
./s3-bulk-redirector.js
with flags to test out - Test:
npm run test
ornpm run test:watch
- Update dependencies
- Update dependencies (commander to v9, csv-parse to 5)
- Update dependencies (including commander to v7, changing options access flow)
- Update dependencies
- Update dependencies
- Update dependencies
- Add private flag (
-p
) to set private ACL for S3 objects
Update to push new README version
Initial release