s3events
s3events
is a command line tool to simulate and send AWS S3 events to new or existing event handlers. Supports SNS, SQS, Lambda.
Sample use cases:
- Resend s3 object created events to event handlers.
- Simulate object removal events without deleting objects.
Installation
npm install -g s3events
Send object creation events in prefix to all attached event handlers
Usage: s3events notify-all <event> <s3Path>--event Event type[required] [choices: "ObjectCreated:*", "ObjectRemoved:*", "ReducedRedundancyLostObject"]--s3Path Example: s3://prefix # Example s3events notify-all ObjectCreated:* s3://bucket-name/data/2017/07/01/18 # Use --dryrun flag to see actions without sending notification s3events notify-all ObjectCreated:* s3://bucket-name/data/2017/07/01/18 --dryrun
Send object creation events in prefix to another SNS topic
Usage: s3events notify-sns <event> <topicArn> <s3Path>--event Event type [required] [choices: "ObjectCreated:*", "ObjectRemoved:*", "ReducedRedundancyLostObject"]--topicArn SNS topic ARN--s3Path Example: s3://prefix # Example # Use --suffix flag to selectively send objects s3events notify-sns ObjectCreated:* arn:aws:sns:us-east-1:123456789:SNSTopicName s3://bucket-name/data/2017/07/01/18 --suffix .gz
Sample S3 event
- Not all the fields of the official S3 event are sent, for example:
awsRegion
,userIdentity
,requestParameters
, etc are not sent. - Only the following fields are sent.
Usage Overview
$ s3events --helpCommands: notify-all <event> <s3Path> Send event
Run from source
yarnnpm link --locals3events --help # Running tests export TMPDIR=/private$TMPDIR # OSX only npm test