David Eyers
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
## Lab 12—AWS Simple Notification Service <!-- Screen captures of 1080x820 --> [Lab 11]: /aPDgQ1qBRvm_4g71edc4DA In this lab we will explore the AWS Simple Notification Service (SNS), which provides a means to disseminate alerts and notifications to sets of targets including through the use of email and SMS messaging. :::info :hourglass_flowing_sand: Generally by this time in semester everyone is very busy, so the extent of new material has been more specifically focused, in order for lab time to be usable for catch-up and getting assistance. There are of course many places that you can further experiment, if you are ahead in terms of the lab material. (Further specifics available on request, as always.) ::: ## Amazon Simple Notification Service (SNS) - To interactively set up SNS, start in the AWS Management Console... ![image](https://hackmd.io/_uploads/SkLcZGfJkx.png) - ... and navigate to the SNS console in the usual way. (Note that if you get taken to the SNS Dashboard, you can use the "breadcrumbs" to return to the top-level SNS web page shown in the following screen capture.) ![image](https://hackmd.io/_uploads/H1LgGGz1kg.png) - The SNS welcome page provides a way to get started using the service. Choose a topic name, and enter it in the provided form control. Click "Next step", to proceed to the more detailed "Create topic" page. ![image](https://hackmd.io/_uploads/BJv7fff11x.png) - Feel free to explore the additional options, but in our test, all that is needed is to scroll to the bottom of that page and click the "Create topic" button. ![image](https://hackmd.io/_uploads/BJzrMGGkyg.png) - Assuming all goes well, you should be returned to the "Topics" display, showing your topic's information, and displaying a green confirmation near the top of the page. - The page indicating that you have created a topic includes a button to publish a message to that topic. Click the "Publish message" button. - The message subject can be set to a value. ![image](https://hackmd.io/_uploads/B1UwMMMyJe.png) - For the moment choose the left-most option regarding "Message structure": to deliver identical payload data to all of the delivery protocols (e.g., different types of devices). - By scrolling down that web page you will find the message body text box. - Enter some content that you will recognise when it is delivered. ![image](https://hackmd.io/_uploads/SyoYffMy1e.png) - At the bottom of the page find and click the "Publish message". - You will be returned to the "Topics" page, with a confirmation banner displayed, if all went well. ![image](https://hackmd.io/_uploads/B1ZsMffJJe.png) - Select the "Dashboard" link on the left-side menu. ![image](https://hackmd.io/_uploads/r1rnMMzJyg.png) - The dashboard indicates that within the `us-east-1` region, this account has a topic registered, but no applications or subscriptions. (In my case I also have some other topic that I didn't define, giving a total of two, and you may or may not have the same total in your AWS Academy account.) - Publishing a message to a topic that has no subscribers will not achieve any visible effect. - Click on the "Subscriptions" left-side menu option. ![image](https://hackmd.io/_uploads/rkQAGfGyJl.png) - Now "Create subscription" to provide a target for publications to reach. - Select the ARN from the pull-down menu that refers to the topic that you created. - Select "Email" as the protocol. - Enter an email address that you control (i.e., not mine, even though it is shown in the screen capture). ![image](https://hackmd.io/_uploads/SJ0bmfMy1g.png) - Click the "Create subscription" button at the bottom of that page. - You will be returned to the "Subscriptions" page, which will indicate the endpoint and the status, which will be "Pending confirmation". ![image](https://hackmd.io/_uploads/BJwmQfM1Jx.png) - Meanwhile, a confirmation request will have been emailed to the address that you entered, and thus you should be able to visit the URL contained within that email message. - A confirmation such as the following screen-capture should be presented. ![image](https://hackmd.io/_uploads/rJEP7ffJye.png) - If you return to the "Subscriptions" page... ![image](https://hackmd.io/_uploads/rkZt7GGy1l.png) - ...you should see that the status has changed to "Confirmed". - Now, just for your interest, select the "Push notifications" left-menu item. ![image](https://hackmd.io/_uploads/rybo7fzkJg.png) - This lab and COSC349 do not go into the details of mobile push notifications, but recall that they are discussed in the Middleware / MBaaS lectures. - In the past, and on your own AWS accounts, you can send SMS messages, although AWS Academy has recently disabled this feature. - You can examine the "Text messaging (SMS)" left-menu item if you are interested. ![image](https://hackmd.io/_uploads/ry-6QzG1Jg.png) :::info :heavy_check_mark: You have now used the main elements of SNS. Let's integrate use of SNS into AWS Lamda. ::: ## Linking SNS to AWS Lambda - Now, let's use SNS from AWS Lambda. In the usual way, navigate to your AWS Lambda console. ![image](https://hackmd.io/_uploads/SJZPrMM1yg.png) - Choose the function that was developed in Lab 10 that reacts to changes in your S3 storage... ![image](https://hackmd.io/_uploads/HyoFHGz1yl.png) - ... and click "Actions" -> "View details". ![image](https://hackmd.io/_uploads/HkroSffJkg.png) - add a destination: ![image](https://hackmd.io/_uploads/BJUr8fGJJg.png) - Change the invocation to be "On success" - Ensure the "Destination type" is "SNS topic" - Select the "Destination ARN" to match your SNS topic. ![image](https://hackmd.io/_uploads/H155IzzkJx.png) - You should now see your SNS destination on the Lambda designer view. ![image](https://hackmd.io/_uploads/HkosIfMJ1g.png) - Scroll down and activate the "Test" tab. ![image](https://hackmd.io/_uploads/ryJTIfG1yg.png) - Invoke a test event to ensure that your configuration is working. - Note, however, that (at least for me) this testing within AWS Lambda does not trigger the SNS destination, and just runs the Lambda function itself. ![image](https://hackmd.io/_uploads/rkRp8fGk1e.png) - Make a modification to your S3 bucket to trigger the AWS Lambda function that itself will generate an SNS notification that should get emailed to you. :::success :pencil: Suggested exercise: Extend your Lambda function so that it disseminates a notification containing relevant data when it has run. For example, when an object is added to the S3 bucket that triggers this Lambda function, the SNS could note the S3 object name and its filetype. ::: :::success :pencil: Suggested exercise: Look up how to interact with SNS using the `aws` command line, and scripting such as `boto3`. (Scripting using `boto3` will be very similar to the code used within your Lambda function, but for the need to manage your credentials differently.) ::: :::success :pencil: Suggested exercise: Reverse the earlier example by developing an AWS Lambda function that subscribes to an SNS topic, rather than generating a publication. :::

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully