Setting-up initial AWS resources for Amazon SNS message archiving and analytics
This page describes how to create the following resources for the message archiving and analytics example use case:
-
An Amazon Simple Storage Service (Amazon S3) bucket
-
Two Amazon Simple Queue Service (Amazon SQS) queues
-
An Amazon SNS topic
-
Two Amazon SQS subscriptions to the Amazon SNS topic
To create the initial resources
-
Create the Amazon S3 bucket:
-
Open the Amazon S3 console
. -
Choose Create bucket.
-
For Bucket name, enter a globally unique name. Keep the other fields as the defaults.
-
Choose Create bucket.
For more information about Amazon S3 buckets, see Creating a bucket in the Amazon Simple Storage Service User Guide and Working with Amazon S3 Buckets in the Amazon Simple Storage Service User Guide.
-
-
Create the two Amazon SQS queues:
-
Open the Amazon SQS console
. -
Choose Create queue.
-
For Type, choose Standard.
-
For Name, enter
ticketPaymentQueue
. -
Under Access policy, for Choose method, choose Advanced.
-
In the JSON policy box, paste the following policy:
{ "Version": "2008-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "sns.amazonaws.com" }, "Action": "sqs:SendMessage", "Resource": "*", "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:sns:us-east-1:123456789012:ticketTopic" } } } ] }
In this access policy, replace the AWS account number (
123456789012
) with your own, and change the AWS Region (us-east-1
) accordingly. -
Choose Create queue.
-
Repeat these steps to create a second SQS queue named
ticketFraudQueue
.
For more information on creating SQS queues, see Creating an Amazon SQS queue (console) in the Amazon Simple Queue Service Developer Guide.
-
-
Create the SNS topic:
-
Open the Topics page
of the Amazon SNS console. -
Choose Create topic.
-
Under Details, for Type, choose Standard.
-
For Name, enter
ticketTopic
. -
Choose Create topic.
For more information on creating SNS topics, see Creating an Amazon SNS topic.
-
-
Subscribe both SQS queues to the SNS topic:
-
In the Amazon SNS console
, on the ticketTopic topic's details page, choose Create subscription. -
Under Details, for Protocol, choose Amazon SQS.
-
For Endpoint, choose the Amazon Resource Name (ARN) of the ticketPaymentQueue queue.
-
Choose Create subscription.
-
Repeat these steps to create a second subscription using the ARN of the ticketFraudQueue queue.
For more information on subscribing to SNS topics, see Creating a subscription to an Amazon SNS topic. You can also subscribe SQS queues to SNS topics from the Amazon SQS console. For more information, see Subscribing an Amazon SQS queue to an Amazon SNS topic (console) in the Amazon Simple Queue Service Developer Guide.
-
You've created the initial resources for this example use case. To continue, see Setting-up a Firehose delivery stream for Amazon SNS message archiving.