gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 07:41:56 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com