Oracle Cloud Event Notification

Send lab feedback

Oracle Cloud Integrated Management Notification



Notifications should be an important part of any customers cloud infrastructure as they can save a lot of time and money. Notifications from applications can send emails or alerts to their users when something happens. For example: a file or order has been processed. That's a potential notification. A developer or DevOps Engineer might also want to know when something has changed in the infrastructure. For example, a DB backup has begun or completed. Notifications sometimes don't even involve users or developers. Notifications can help when customers have a serverless function that needs to run when an object is uploaded to Object Storage. There are many different activities that fall under the umbrella term "notification" and ONS can handle just about every scenario you can think of.

Overall Lab Objectives

  • Create a notification including configuration of an Oracle cloud topic, subscription and event

Lab Overview Video

Watch this video to see an accelerated review of the tasks in this lab.

Demonstration Video


Contact us

Having an issue with the lab? Have an idea on how it could be made better? Want to tell us how awesome the lab is? Click the icon below to contact the team and let us know your feedback.

Task 1: Create a Notification

  1. Click the OCI console action menu located in the upper left corner of the console page, select Developer Services, then under Application Integration select Notifications.

  1. Select your assigned compartment from the List Scope drop down on the left side of the page. Click the +/- buttons to find your specific compartment. Select the compartment name that is listed underneath Luna-Labs.

A Topic is a communication channel for sending messages to the subscriptions in the topic. Each topic name is unique across the tenancy.

  1. Click on the Create Topic button.

  1. Name your topic and provide an optional description, then click the Create button.

  1. Verify that your topic appears in the dialog and review the information provided.

A subscription is an endpoint for a topic. Published messages are sent to each subscription for a particular topic. The following subscription protocols are currently supported:

  • Email: Messages are sent to a specified email address.
  • HTTPS (PagerDuty): Messages are sent to PagerDuty.
  • HTTPS (Webhook) : Messages are sent to HTTPS endpoint.
  • Slack: Messages are sent to a Slack channel
  • Oracle Functions : Invoke an Oracle Function
  • SMS : Messages are sent to an SMS enabled phone number
  1. Setup a subscriber to your topic. Select the Subscriptions link and click on the Create Subscription button.

  1. In a production environment, you might have many subscription topics. In our case we only have the topic you just configured so it should show up as the default. If not, choose notification_topic in the drop-down list. Choose Email as the protocol and type in your work email address. You need to provide a valid email to receive the notification messages. Click the Create button at the bottom of the page.

  1. A new Subscription will appear with its status as Pending.

  1. Check your email. Shortly you should receive a message titled Oracle Cloud Infrastructure Notifications Service Subscription Confirmation in your inbox. If not, check your junk email box. Open the message and click the Confirm subscription link.

  1. On the system where you're checking your email, a confirmation will appear in your web browser.

  1. Your subscription should update to active status. Refresh the browser if necessary to check if the status has changed.

Task 2: Create an Event

Oracle Cloud Infrastructure Events enables you to create automation based on the state changes of resources throughout your tenancy. Use Events to allow your development teams to automatically respond when a resource changes its state.

Here are some examples of how you might use Events:

  • Send a notification to a DevOps team when a database backup completes.
  • Convert files from one format to another when files are uploaded to an Object Storage bucket.

For this exercise you will create an event that will send you an email to let you know when a compute service has finished provisioning.

  1. Click on the OCI Action menu located in the upper left corner of the console page, select Observability & Management. Under the Events Service heading select Rules.

  1. On the Rules page, click the Create Rule button.

Fill out the dialog on the Create Rule page with the following information. There are three basic sections to the rule.

  1. Enter a display name and a description for your rule. Call it compute-notify-rule if you wish.

  2. In the Rule Conditions section the Condition is Event Type, select Compute from the Service Name drop-down, and choose Instance - Launch End for the Event Type.

  3. In the Actions section select Notifications as the Action Type. Choose your assigned compartment from the Notifications Compartment list and select the Topic you created earlier from the list. It should be called notification_topic.

Note: in the drop-down lists, you can type the term you're looking for to quickly locate it instead of scrolling through the long lists.

  1. Once you select the Create Rule button, a page will be shown indicating that your rule is now active.

Task 3: Launch a compute instance

In this task, you will launch a compute instance to test your new rule.

  1. Click on the Action menu on the OCI console and select Compute then Instances.

  1. Ensure that your assigned compartment is selected and click the Create Instance button.

  1. Review the details and accept all defaults for this dialog. The dialog will provide a default name, network, ip information and more. The only thing you need to do on the Create compute instance dialog is tell it that we don't want to use SSH keys. We're just creating the instance, we're not going to actually login or use it for anything. Just as an example of launching the system is all we need. Choose the radio button for No SSH keys and click Create.

  1. Your instance will begin provisioning and you will see the orange icon labeled Provisioning.

  1. Wait a few moments until your system icon turns green and it enters the Running stage.

  1. Check your email for a notification like the one below alerting you to a system launch on the Oracle Cloud.

You have successfully created an event and a notification.

As an extra challenge, create an event and notification for when a compute instance is terminated. Then terminate the instance and see if you recieve a notification.

Summary of Learning

  • You can utilize Oracle Cloud observability and management notification capabilities
  • You've experienced first hand how service notifications are created
  • You can demonstrate this service to others and illustrate how it can help business be more efficient

Contact us

Having an issue with the lab? Have an idea on how it could be made better? Want to tell us how awesome the lab is? Click the icon below to contact the team and let us know your feedback.