If the S3 buckets that you want to index are in multiple regions, edit the CloudFormation file to do the following:
Create one AWS::SNS::Topic per region.
Create an AWS::SNS::Subscription for each SNS topic, all pointing to the same SQS queue in your Scanner instance.
Setting up bucket notifications
To allow Scanner to index log files continuously, you will need to configure your S3 buckets to send "object created" notifications to an SNS topic created by CloudFormation earlier, which will forward the notifications to an SQS queue running in your Scanner instance. Setting up bucket notifications cannot be done directly in CloudFormation without the CloudFormation stack taking full ownership of the S3 bucket, which we don't necessarily want.
Here is how to set up bucket event notifications manually using the AWS console.
Navigate to S3 > (Click on your bucket) > Properties.
Scroll down to Event notifications.
Click Create event notification
Give it an Event name. Optionally provide a Prefix and Suffix to filter down to a specific set of files.
Select the checkbox next to All object create events - s3:ObjectCreated:*.
Scroll down to Destination. Select SNS topic. Under Specify SNS topic, select Choose from your SNS topics. Select the SNS topic created by Scanner's CloudFormation template earlier:
scnr-LogsBucketEventNotificationTopic
This SNS topic is already configured with a subscription to push bucket event notifications to Scanner's SQS queue.
Click Save changes.
Object creation notifications should now be sent to your Scanner instance.
What if I already have a conflicting destination for bucket event notifications?
You might be sending bucket notifications to a different destination already, like to the SQS queue of another vendor, to a different SNS topic, or to a Lambda function.
To resolve this situation, we recommend the following configuration:
Configure the bucket to push event notifications to an SNS topic.
Configure the SNS topic to relay messages to multiple destinations by creating subscriptions:
Create a topic subscription for Scanner
Protocol: SQS
Endpoint: ARN of your Scanner instance's SQS queue. Your contacts on the Scanner team can give this to you.
Enable raw message delivery.
Create topic subscriptions for your other vendors and destinations.