I have A service where we have sns topics and in B service sqs queue event.
from B service cloud formation I need to write the cloud formation YAML file to subscription between SNS event topic and SNS event queue.
sns topic name : sns-event-topic
subscribed to queue name: abcd-events
Resources:
AbcdEventQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "abcd-events"
AbcdEventQueuePolicy:
Type: "AWS::SQS::QueuePolicy"
Properties:
Queues:
- Ref: "AbcdEventQueue"
PolicyDocument:
Statement:
- Effect: "Allow"
Principal:
AWS: '*'
Action:
- sqs:SendMessage
- sqs:ReceiveMessage
- sqs:DeleteMessage
- sqs:GetQueueUrl
- sqs:GetQueueAttributes
- sqs:ListQueueTags
- sqs:ChangeMessageVisibility
Resource:
- !GetAtt AbcdEventQueue.Arn