1 00:00:00,530 --> 00:00:02,480 ‫Okay, so let's practice using SNS. 2 00:00:02,480 --> 00:00:03,770 ‫So I'm going to go into 3 00:00:03,770 --> 00:00:06,230 ‫the simple notification service console, 4 00:00:06,230 --> 00:00:10,240 ‫and I'm going to create a topic called demo SNS. 5 00:00:10,240 --> 00:00:12,300 ‫Now this topic will leave it 6 00:00:12,300 --> 00:00:13,910 ‫as default for all the options, 7 00:00:13,910 --> 00:00:16,210 ‫and we'll just click simply on create topics. 8 00:00:16,210 --> 00:00:17,690 ‫So the idea is that we want to send messages 9 00:00:17,690 --> 00:00:19,100 ‫to this SNS topic, 10 00:00:19,100 --> 00:00:20,860 ‫and we want subscribers to this topic 11 00:00:20,860 --> 00:00:22,280 ‫to receive the messages. 12 00:00:22,280 --> 00:00:25,090 ‫So we can define subscriptions here currently we have zero, 13 00:00:25,090 --> 00:00:26,780 ‫but it will create a subscription, 14 00:00:26,780 --> 00:00:27,613 ‫and as you can see 15 00:00:27,613 --> 00:00:29,880 ‫we have different protocols for your subscription. 16 00:00:29,880 --> 00:00:34,670 ‫It could be HTTP, HTTPS, Email, Email-JSON, SQS and Lambda. 17 00:00:34,670 --> 00:00:37,100 ‫So lots of different targets for your SNS, 18 00:00:37,100 --> 00:00:40,090 ‫and as you remember, if you send a message to one SNS topic, 19 00:00:40,090 --> 00:00:42,190 ‫then all the subscribers whatever they might, 20 00:00:42,190 --> 00:00:44,820 ‫may be in terms of protocol will receive that message. 21 00:00:44,820 --> 00:00:45,653 ‫For this hands on 22 00:00:45,653 --> 00:00:47,890 ‫we'll just go with email because it's easy. 23 00:00:47,890 --> 00:00:49,100 ‫And for the endpoints, 24 00:00:49,100 --> 00:00:52,717 ‫I'm going to go for stephaneccpdemo@mailinator.com. 25 00:00:55,200 --> 00:00:56,060 ‫Now if you don't know this, 26 00:00:56,060 --> 00:00:59,290 ‫this is a service to get a temporary email address. 27 00:00:59,290 --> 00:01:02,340 ‫So if I click and enter, 28 00:01:02,340 --> 00:01:04,920 ‫if I enter this defense CCP demo mailbox, 29 00:01:04,920 --> 00:01:06,950 ‫this is a temporary mailbox for me. 30 00:01:06,950 --> 00:01:08,280 ‫So I'm going to use this mailbox, 31 00:01:08,280 --> 00:01:10,430 ‫and I'm going to create a subscription. 32 00:01:10,430 --> 00:01:13,510 ‫And now if we go back to the demo SNS topic, 33 00:01:13,510 --> 00:01:16,360 ‫we can see that the subscription is pending confirmation. 34 00:01:17,240 --> 00:01:18,850 ‫Very easy for this to fix it, 35 00:01:18,850 --> 00:01:21,860 ‫I'm gonna go into my Mailinator mailbox and as you can see, 36 00:01:21,860 --> 00:01:23,630 ‫I have an email from AWS, 37 00:01:23,630 --> 00:01:25,100 ‫asking me to confirm my subscription 38 00:01:25,100 --> 00:01:26,900 ‫which I will do right now. 39 00:01:26,900 --> 00:01:29,070 ‫So my subscription ID is confirmed, 40 00:01:29,070 --> 00:01:30,100 ‫and what you could do, 41 00:01:30,100 --> 00:01:33,800 ‫if you are savvy would be to create other subscriptions. 42 00:01:33,800 --> 00:01:35,610 ‫They're more complicated to create besides email, 43 00:01:35,610 --> 00:01:37,330 ‫so we'll just keep it as one for now. 44 00:01:37,330 --> 00:01:40,900 ‫But you could have many subscribers for your SNS topic. 45 00:01:40,900 --> 00:01:41,960 ‫So now what I'm going to do is 46 00:01:41,960 --> 00:01:44,530 ‫to practice sending a message to my SNS topic. 47 00:01:44,530 --> 00:01:46,180 ‫For this I'm going to publish message, 48 00:01:46,180 --> 00:01:48,890 ‫say demo subject line, 49 00:01:48,890 --> 00:01:53,150 ‫and then I will say hello world in terms of payload. 50 00:01:53,150 --> 00:01:55,820 ‫And then finally I'm going to publish this message, 51 00:01:55,820 --> 00:01:58,180 ‫and the message has not been published successfully. 52 00:01:58,180 --> 00:02:00,090 ‫And so all the subscribers in my subscription 53 00:02:00,090 --> 00:02:01,430 ‫should receive that message. 54 00:02:01,430 --> 00:02:04,850 ‫So if we go into Mailinator, go back to my inbox, 55 00:02:04,850 --> 00:02:07,710 ‫I can see that moments ago I received a new email 56 00:02:07,710 --> 00:02:09,820 ‫called demo subject line, 57 00:02:09,820 --> 00:02:13,160 ‫and the content says hello world, so this has worked. 58 00:02:13,160 --> 00:02:16,420 ‫So this is a very simple demo of how SNS works. 59 00:02:16,420 --> 00:02:19,370 ‫And when you're done, you can go ahead and delete the topic. 60 00:02:19,370 --> 00:02:21,380 ‫If you want it too, it won't cost you any money. 61 00:02:21,380 --> 00:02:22,770 ‫So that's it I hope that was helpful, 62 00:02:22,770 --> 00:02:24,720 ‫and I will see you in the next lecture.