Bird
0
0

Given this AWS SNS subscription code snippet:

medium📝 service behavior Q13 of 15
AWS - SNS and SQS
Given this AWS SNS subscription code snippet:
sns.subscribe({
  Protocol: 'lambda',
  Endpoint: 'arn:aws:lambda:us-east-1:123456789012:function:ProcessMessage'
});

What happens when a message is published to this SNS topic?
AThe Lambda function 'ProcessMessage' is invoked with the message payload.
BThe message is sent as an SMS to the Lambda function ARN.
CThe message is sent as an email to the Lambda function.
DThe subscription will fail because Lambda cannot be an endpoint.
Step-by-Step Solution
Solution:
  1. Step 1: Identify protocol and endpoint meaning

    Protocol 'lambda' means SNS invokes the specified Lambda function ARN when a message is published.
  2. Step 2: Understand message delivery behavior

    The Lambda function 'ProcessMessage' is called with the message payload as input.
  3. Final Answer:

    The Lambda function 'ProcessMessage' is invoked with the message payload. -> Option A
  4. Quick Check:

    Lambda protocol triggers function invocation [OK]
Quick Trick: Lambda protocol triggers function call, not email or SMS [OK]
Common Mistakes:
MISTAKES
  • Thinking Lambda receives email or SMS
  • Assuming subscription fails
  • Confusing endpoint ARN with phone/email

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes