mc event add command adds event notification triggers to a bucket.
MinIO automatically sends triggered events to the configured notification target.
The following command creates a new event notification trigger for
DELETE operations for the
mydata bucket on the
myminio MinIO deployment:
mc event add --event "put,delete" myminio/mydata arn:aws:sqs::primary:target
The specified ARN corresponds to a configured
bucket notification target on the
The command has the following syntax:
mc [GLOBALFLAGS] event add \
[--event "string"] \
[--prefix "string"] \
[--suffix "string"] \
indicate optional parameters.
Parameters sharing a line are mutually dependent.
Parameters separated using the pipe
|operator are mutually exclusive.
Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.
Required The MinIO alias and bucket to which the command adds the new event notification. For example:
mc event add play/mybucket
Required The Amazon Resource Name (ARN) of the notification target.
The MinIO server outputs an ARN for each configured notification target at server startup. See Bucket Notifications for more information.
Optional The event(s) for which MinIO generates bucket notifications.
Supports the following values:
Specify multiple value using a comma
See Supported Bucket Events for a detailed list of S3 events associated to each of the supported values.
- ignore-existing, p
Optional Directs MinIO to ignore applying the specified event triggers if an existing matching trigger exists.
Optional The bucket prefix in which the specified
--eventcan trigger a bucket notification.
Omit to trigger the event for all prefixes and objects in the bucket.
This command supports any of the global flags.
The following command adds a new event notification trigger for all
DELETE operations on a bucket. The command
assumes the MinIO deployment has at least one configured
bucket notification target:
mc event add myminio/mydata arn:minio:sqs::primary:webhook
Corresponding S3 Events
For more complete documentation on the listed S3 events, see S3 Supported Event Types.
The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.
MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.