amazon-web-services - 如何使用cloudformation迁移sns和sqs?

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

在我的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             

最佳答案

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

Former2 allows you to generate Infrastructure-as-Code outputs from your existing resources within your AWS account. By making the relevant calls using the AWS JavaScript SDK, Former2 will scan across your infrastructure and present you with the list of resources for you to choose which to generate outputs for.

关于amazon-web-services - 如何使用cloudformation迁移sns和sqs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64929106/

相关文章:

azure - 使用云服务进行并行文件处理

amazon-web-services - 具有资源属性 CloudFormation 的 UserData 脚本

grails - Grails 2.5.1至Grails 3.3.2

amazon-web-services - 用于为 SQS 创建角色的 Cloudformation 模板

amazon-web-services - 在无服务器中创建 S3 存储桶策略 - 发生错误 : BucketPolicy - Invalid policy syntax

amazon-web-services - c :209: allocator ! = ((void *)0) 中发生 fatal error 情况 - aws-sdk-cpp

node.js - 我在EC2上运行nodejs时出错

android - aws cognito 与 facebook 登录? - 安卓

java - Spring Boot中一个类的多个配置树

amazon-web-services - AWS Nested Stacks - 引用父堆栈的资源