【问题标题】:How to migrate sns and sqs using cloudformation?如何使用 cloudformation 迁移 sns 和 sqs?
【发布时间】:2021-03-03 20:20:48
【问题描述】:

在我的 aws 帐户中,有 250 多个 SNS 和 SQS 我需要使用 cloudformation 将一个区域迁移到另一个区域,任何人都可以帮助使用 yaml 编写脚本

Resources:
  T1:
    Type: 'AWS::SNS::Topic'
    Properties: {}

  Q1:
    Type: 'AWS::SQS::Queue'
    Properties: {}

  Q1P:
    Type: 'AWS::SQS::QueuePolicy'
    Properties:
      Queues:
        - !Ref Q1
      PolicyDocument:
        Id: AllowIncomingAccess
        Statement:
          -
            Effect: Allow
            Principal:
              AWS:
                - !Ref AWS::AccountId
            Action:
              - sqs:SendMessage
              - sqs:ReceiveMessage
            Resource:
              - !GetAtt Q1.Arn
          -
            Effect: Allow
            Principal: '*'
            Action:
              - sqs:SendMessage
            Resource:
              - !GetAtt Q1.Arn

  T1SUB:
    Type: 'AWS::SNS::Subscription'
    Properties:
      Protocol: sqs
      Endpoint: !GetAtt Q1.Arn
      TopicArn: !Ref T1             

【问题讨论】:

    标签: amazon-web-services yaml amazon-cloudformation amazon-sqs amazon-sns


    【解决方案1】:

    您可以尝试使用Former2 这是一个开源工具:

    Former2 允许您在 AWS 账户中从现有资源中生成基础设施即代码输出。通过使用 AWS JavaScript 开发工具包进行相关调用,Former2 将扫描您的基础设施,并为您提供资源列表,供您选择要为其生成输出的资源。

    【讨论】:

      猜你喜欢
      • 2021-07-20
      • 2021-08-12
      • 1970-01-01
      • 2020-06-01
      • 2012-03-09
      • 2016-08-01
      • 2017-03-27
      • 2020-11-28
      • 1970-01-01
      相关资源
      最近更新 更多