AWS-SNS Flashcards
What is a publisher?
The entity that pushes to the topic for the SNS
What is the topic?
Object that you use to publish messages.
What is a subscriber?
Entity that receives messages from the tropic.
What are the SNS subscriber entities available?
HTTP HTTPs Email Email-Json SQL Mobule Lambda SMS
Some publishers to SNS?
- App
- S3 Event
- CloudWatch Alarm
What is the max message?
256KB
When using SNS, explain fanout?
The fan-out patter refers to the ability of SNS to send a multipal notification to many subscribers. Think of it 1 message send fan out to millions of subscribers. This is where we use SNS and SQS, we create multiple SQS Qs and subscribe them to SNS topic, a service like s3 could send messages to the topic when video files arrive this would enable us to have a Q for each video resolution.
I require my data to be encrypted at rest, what are my options?
SNS has the ability to use SSE, you can use AWS or Customer managed keys.
Is SNS suitable for high-speed messaging, if not explain why?
It is a notification service, it is intended to send a message to a subscriber. The subscriber could be mobile or an email, this is not high speed.
I want to send push notification to my customer mobile devices, how cna I make this possible?
You can use SNS, SNS is able to send push notification to Android, iOS and Windows mobile devices.
Is SNS Push notification the same as SNS SMS notification, explain the difference?
Push notification uses the Android (google0, iOS (Apple), Windows Mobile (Microsoft) network to send the messages, SNS connects to these networks. SNS SMS send an SMS message directly to the user mobile using the users mobile phone number.
I want to receive notifications form SNS and process some logic with some GO code, how can I do this?
SNS supports Lambda as a subscriber, Lambda supports GO. You can subscribe the lambda to the SNS and have it execute the GO code.
What is AWS SNS?
Simple Notification Services is a service thet enables a publisher to send a message to SNS where will that messages to it subscribers.
What are the key entries in SNS?
Publishers, topics and subscribers.
How can we monitor our SNS topic?
SNS publishes metrics to CloudWatch
My orgnization requires thet all data be encrypted and secure at rest and in transit, how can we secure our SNS topic?
We can enable encryption on our SNS topic this will ensure the topic data is encrypted at rest. HTTPS is used to transport data to the tropic so data is secure. IAM is normally employed to access is secured. The subscriber channels may not be secure as they use a range of native protocols.
Describe how data is encrypted for SNS?
KMS is employed and either AWS managed CMK or customer CMK is used as part of the encryption, encryption is AES256.
How can we allow everyone to form another AWS account subscribe to this SNS topic?
Use SNS access control policy, much like S3 access control policy, SNS has separate access control policies, separate from IAM. You would use the following policy,
{ "Statement": [{ "Sid": "grant-1234-publish", "Effect": "Allow", "Principal": { "AWS": "111122223333" }, "Action": ["sns:Suscribe"], "Resource": "arn:aws:sns:us-east-2:444455556666:MyTopic" }] }
What is an SNS access control policy?
SNS access control policy enables you to have a separate policy per topic form controlling access. Like giving access to another account, ensuring the caller is using HTTPS?
My org has a policy thet means all data in transit and at rest is encrypted, how cna I ensure the callers of a topic are secure?
Enforce the use of HTTPs by using an access control policy to restrict the user to use HTTPs only, note the condition in the following policy,
{ "Statement": [{ "Sid": "Allow-SNS-SendMessage", "Effect": "Allow", "Principal": "*", "Action": ["sqs:SendMessage"], "Resource": "arn:aws:sqs:us-east-2:444455556666:MyQueue", "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:sns:us-east-2:444455556666:MyTopic" } } }] }
I have an s3 bucket in a separate AWS account, I have 1M customers subscribed to an SNS topic in this account separate from the account with the bucket. Each time a file is put in the bucket I wnat to send a notification to the 1M subscribers, how cna I do this?
- Set up an S3 event and set the event to trigger to put’s
- Have the event public to SNS in the separate account by using an ARN with the account ID in it.
- Create an SMS access control policy to allow this account S3 to publish to this SNS topic
What is the max message SNS message size?
256KB
Explain FAN out in relation to SNS?
Fanout is where you send one messing to an SNS topic but there is many messages sent out to subscribers. One in many out.
I am using Cloudformation and I wnat cloud formation to send messages to my 1M SNS topic subscribers, how cna I do this?
You can create a custom resource and provide the SNS topic ARN cna pass parameters, cloud formation will call SNS.