简体   繁体   中英

How to create and subscribe an Amazon SQS queue to an Amazon SNS topic in AWS CloudFormation?

How to create and subscribe an Amazon SQS queue to an Amazon SNS topic in AWS CloudFormation?

  • SNS topic name = T1
  • SQS queue name = Q1

I need a template in JSON or YAML

Pease help me.

Here is an example from Create a Subscription Between an Amazon SQS Queue and an Amazon SNS Topic in AWS CloudFormation :

Parameters:
  SNSTopicARN:
    Type: String
    Description: awsSNSTopicArnExample 
  TopicRegion:
    Type: String
    Description: us-east-1

Resources:
  Queue:
    Type: AWS::SQS::Queue

  SnsSubscription:
    Type: AWS::SNS::Subscription
    Properties:
      Protocol: sqs
      Endpoint: !GetAtt Queue.Arn
      Region: !Ref TopicRegion
      TopicArn: !Ref SNSTopicARN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM