AWS-SNS Flashcards

1
Q

What is a publisher?

A

The entity that pushes to the topic for the SNS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the topic?

A

Object that you use to publish messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a subscriber?

A

Entity that receives messages from the tropic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the SNS subscriber entities available?

A
HTTP
HTTPs
Email
Email-Json
SQL
Mobule
Lambda
SMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Some publishers to SNS?

A
  • App
  • S3 Event
  • CloudWatch Alarm
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the max message?

A

256KB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When using SNS, explain fanout?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

I require my data to be encrypted at rest, what are my options?

A

SNS has the ability to use SSE, you can use AWS or Customer managed keys.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Is SNS suitable for high-speed messaging, if not explain why?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

I want to send push notification to my customer mobile devices, how cna I make this possible?

A

You can use SNS, SNS is able to send push notification to Android, iOS and Windows mobile devices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is SNS Push notification the same as SNS SMS notification, explain the difference?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

I want to receive notifications form SNS and process some logic with some GO code, how can I do this?

A

SNS supports Lambda as a subscriber, Lambda supports GO. You can subscribe the lambda to the SNS and have it execute the GO code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is AWS SNS?

A

Simple Notification Services is a service thet enables a publisher to send a message to SNS where will that messages to it subscribers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the key entries in SNS?

A

Publishers, topics and subscribers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can we monitor our SNS topic?

A

SNS publishes metrics to CloudWatch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

My orgnization requires thet all data be encrypted and secure at rest and in transit, how can we secure our SNS topic?

A

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.

17
Q

Describe how data is encrypted for SNS?

A

KMS is employed and either AWS managed CMK or customer CMK is used as part of the encryption, encryption is AES256.

18
Q

How can we allow everyone to form another AWS account subscribe to this SNS topic?

A

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"
  }]
}
19
Q

What is an SNS access control policy?

A

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?

20
Q

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?

A

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"
      }
    }
  }]
}
21
Q

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?

A
  • 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
22
Q

What is the max message SNS message size?

A

256KB

23
Q

Explain FAN out in relation to SNS?

A

Fanout is where you send one messing to an SNS topic but there is many messages sent out to subscribers. One in many out.

24
Q

I am using Cloudformation and I wnat cloud formation to send messages to my 1M SNS topic subscribers, how cna I do this?

A

You can create a custom resource and provide the SNS topic ARN cna pass parameters, cloud formation will call SNS.

25
Q

I have an EC2 instance and I wnat it to send a notification to all 1M subscribers of my SNS topic when the CPU is over 80%, how cna I do this?

A

Use CloudFormation to create an alarm when CPU is over 80% and provide the ARN of the SNS topic for the notification.

26
Q

I have an EC2 instance and I wnat it to send a notification to all 1M subscribers of my SNS topic when the CPU is over 80%, how can I do this?

A

Use CloudFormation to create an alarm when CPU is over 80% and provide the ARN of the SNS topic for the notification.

27
Q

I wnat the 1M subscribers of my SNS topic to get notified when the state changes on my EC2 instances, how can I do this?

A

You can use CloudWatch events for when the state changes and use a CW event target of the SNS and its ARN.

28
Q

I have an HTTPS service that I wnat to notify when my EC2 state changes, how can I do this?

A

You can use CloudWatch events for when the state changes and use a CW event target of the SNS and its ARN. Create an HTTPS topic subscriber for the HTTPS service.

29
Q

Can I subscribe lambda to SNS topic?

A

Yes 100%

30
Q

I require a JSON email notification when my EC2 instance changes, how cna I do this?

A

You can use CloudWatch events for when the state changes and use a CW event target of the SNS and its ARN. Create an email-JSON topic subscriber for the HTTPS service

31
Q

Can I get notifies by mobile text message form SNS?

A

Yes

32
Q

I am using S3 to receive customer video uploads, I have 3 lambda functions, 1 for 1080p, 1 of 720p and 1 for 480p conversion of video format. We have to use SQS and SNS in the solution, how cna I do this?

A

FAN out architecture.

  • S3 event to get notified when there is a upload with SNS ARN as a target
  • SNS Topic to receive notifications
  • SQS as a subscriber of the SNS topic, SQS is used because it is a queue and queues what is next to be processed
  • Lambda as a subscriber of the SQS.
33
Q

How cna we have CloudWatch notify customers with events?

A

Have it use SNS

34
Q

Is SNS a queue?

A

No, you need SQS for this.

35
Q

I am using SNS with HTTPs and sometimes I get a fail, what can I do to ensure the SNS notification gets delivered by HTTPs when it fails?

A

SNS has a retry for HTTPS notifications

36
Q

I want to get better visibility into the status of SNS delivered messages, what options do I have?

A

SNS can use CloudWatch logs to capture the delivery status of messages.

37
Q

How cna I send messages using SMS for my mobile phone using push notifications?

A

You can use SNS and use the SMS push notifications

38
Q

I wnat to push messages to Whats app, how can I do this?

A

SNS does not support what’s an app but is supports Lambda as a subscriber. We can use Lambda and use the Whats app API. This way we create a topic and have the subscriber be our Lambda functions and the Lambda function using the What’s app API to send message to Whats app.