This topic describes how to configure event notification in the OSS console.

Prerequisites

If you want to use a RAM user to configure the event notification feature for a bucket, the RAM user must have management permissions (defined by the AliyunMNSFullAccess policy) on Message Service (MNS) and the bucket.

Background information

OSS uses event notification to send notifications about operations on OSS resources at your earliest opportunity. Example:

  • New data is uploaded from image sharing platforms or audio and video platforms to OSS.
  • Relevant content in OSS is updated.
  • Important objects in OSS are deleted.
  • Data synchronization in OSS is completed.
Notice
  • Notifications are not sent for the TS and M3U8 objects that are generated by using RTMP ingest.
  • The event notification feature is available in all regions except the China (Heyuan), China (Hohhot), UAE (Dubai) and Malaysia (Kuala Lumpur) regions.

For more information about event notification, see Event notification.

Procedure

  1. Log on to the OSS console.
  2. Click Buckets, and then click the name of the target bucket.
  3. Choose Basic Settings > Event Notification. Click Configure.
  4. Click Create Rule. In the Create Rule dialog box that appears, configure an event notification rule.

    The following table describes the parameters.

    Parameter Description
    Rule Name Specify the name of the event notification rule.
    Events Select one or more events that you want to be notified of. An event can be selected only once for a resource. Event types correspond to different operations on OSS resources. For more information about event types and their descriptions, see Event types.
    Resource Description Set the information of the object that you want to follow. The resource description can be a full name, a prefix, a suffix, or a combination of a prefix and a suffix. Different resource descriptions cannot overlap. After this parameter is specified, this event notification rule sends message notifications only when the corresponding object changes.
    • Full Name: Set the complete path of an object to receive notifications about the object. Example: test/myphoto/photo1.jpg.
    • Prefix and Suffix: Set the prefix and suffix to receive notifications about all or multiple objects in a bucket. For example, for a bucket named nightbucket:
      • To receive notifications about all objects, do not set Prefix or Suffix.
      • To receive notifications about objects in the movie folder, set Prefix to movie/ and leave Suffix unspecified.
      • To receive notifications about all .jpg images, set Suffix to .jpg and leave Prefix unspecified.
      • To receive notifications about videos in the MP3 format in the movie folder, set Prefix to movie/ and Suffix to .mp3.
    Note You can click Add to specify a maximum of five Resource Description entries.
    Endpoint Add one or more endpoints. Event notifications can be sent to one or more HTTP endpoints or queues.
    Note
    • When a notification rule is triggered by an operation, OSS event notification generates a message and publishes the message to an MNS topic. MNS sends the message to the subscribed endpoint.
    • MNS is a paid service. For more information, see Alibaba Cloud Message Service (MNS) pricing.
    • For more information about error messages, see Error codes.
  5. Click OK.