I'm trying to setup Amazon Ses notifications to go to my SQS Queue. I'm following instructions how to create SQS queue, then SNS topic, and subscribe one to the other.
However in the management console the subscriptions come up "Pending Confirmation".
I'm using the .NET AWS SDK, how can Confirm the subscription? Or even better, why do I have to confirm? The documentation says
If the owner of the queue creates the subscription, the subscription is automatically confirmed and the subscription should be active almost immediately.
I'm using my AWS credentials for all the API calls as owner so I dont see why I need to confirm but how can I anyways?
private static string CreateBounceTopicAndQueue(IAmazonSQS sqsClient, IAmazonSimpleNotificationService snsClient)
{
// 1. Create an Amazon SQS queue named ses-bounces-queue.
CreateQueueResponse createQueueResponse = sqsClient.CreateQueue(new CreateQueueRequest()
{
QueueName = AppGlobal.SesBouncesQueue,
Attributes = new Dictionary<string, string>() {
{ "ReceiveMessageWaitTimeSeconds", "20" }
}
});
string queueUrl = createQueueResponse.QueueUrl;
// 2. Create an Amazon SNS topic named ses-bounces-topic
CreateTopicResponse createTopicResponse = snsClient.CreateTopic(new CreateTopicRequest
{
Name = AppGlobal.SesBouncesTopic
});
string topicArn = createTopicResponse.TopicArn;
// 3. Configure the Amazon SNS topic to publish to the SQS queue
var response = snsClient.Subscribe(new SubscribeRequest
{
TopicArn = topicArn,
Endpoint = queueUrl,
Protocol = "https"
});
return queueUrl;
}