Skip to content

Instantly share code, notes, and snippets.

@benc-uk
Last active May 2, 2024 13:53
Show Gist options
  • Save benc-uk/c06ca79ad5b43d8c5e565bce339fd829 to your computer and use it in GitHub Desktop.
Save benc-uk/c06ca79ad5b43d8c5e565bce339fd829 to your computer and use it in GitHub Desktop.
Fake and mock SNS messages with VSCode HTTP extension
# Fake SNS messages with VSCode REST Extension
# Install this - https://marketplace.visualstudio.com/items?itemName=humao.rest-client
@TOPIC_ARN = "arn:aws:sns:us-east-1:286528903076:BenTestTopic"
###
# Fake SNS message subscription
POST http://localhost:8000/sns/subscription
x-amz-sns-message-type: SubscriptionConfirmation
x-amz-sns-message-id: {{$guid}}
x-amz-sns-topic-arn: {{TOPIC_ARN}}
{
"SubscribeURL": "https://example.net/",
"TopicArn": {{TOPIC_ARN}}
}
###
# Fake SNS message (type = Notification)
POST http://localhost:8000/sns/subscription
x-amz-sns-message-type: Notification
x-amz-sns-message-id: {{$guid}}
x-amz-sns-topic-arn: {{TOPIC_ARN}}
{
"TopicArn": {{TOPIC_ARN}},
"Message": "Hello from SNS!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment