简体   繁体   English

我们可以从现有 VPC 中导出 Cloud Formation 模板吗?

[英]Can we export Cloud Formation template from an existing VPC?

We have a VPC which contains all services and databases used for the testing.我们有一个 VPC,其中包含用于测试的所有服务和数据库。 We are now planning to setup another such VPC, so that we can have an extra testing env.我们现在计划设置另一个这样的 VPC,以便我们可以有一个额外的测试环境。

Is there a way to export the CloudFormation template from the existing infrastructure ( VPC )?有没有办法从现有基础设施 (VPC) 中导出 CloudFormation 模板?

Depends upon what all you want to clone/duplicate as well as to what level you would like to duplicate resources, you can look at following options;取决于您想要克隆/复制的所有内容以及您想要复制资源的级别,您可以查看以下选项;

  1. Use deprecated CloudFomer which is part of AWS CFN, you can built templates from your existing resources.使用 AWS CFN 中已弃用CloudFomer ,您可以从现有资源构建模板。 Not recommended, just putting in list in case your use-cases are meet with this with less efforts, time and money.不推荐,只需列出清单,以防您的用例以更少的努力、时间和金钱满足此要求。

  2. Use former2 a third party tool, which is more reliable than CloudFomer.使用former2 第三方工具,比CloudFomer 更可靠。 Please refer this existing thread for more details.请参阅此现有线程以获取更多详细信息。

  3. Use N2WS , a third party partnered solution with AWS.使用N2WS ,这是与 AWS 合作的第三方解决方案。 Please refer this Blog from AWS.请参阅 AWS 的此博客。

  4. Use CloudRanger , third party solution knows as Druva.使用CloudRanger ,第三方解决方案称为 Druva。

If the existing infrastructure were created using CloudFormation then you can just run the following command:如果现有基础架构是使用 CloudFormation 创建的,那么您只需运行以下命令:

aws cloudformation get-template --stack-name myteststack

If not it's not possible because aws only uses cloudformation stacks visible for clients in products than you can change parameters after creation, like ECS.如果不是,那是不可能的,因为 aws 仅使用对产品中的客户端可见的 cloudformation 堆栈,而不是您可以在创建后更改参数,例如 ECS。

You can export Cloud Formation template using Functionbeat which is Elastic Beat that we can deploy as a function in our serverless environment to collect data from cloud services.您可以使用 Functionbeat 导出 Cloud Formation 模板,该模板是 Elastic Beat,我们可以在我们的无服务器环境中将其部署为 function 以从云服务收集数据。 After configuring functionbeat use the following command to export the CloudFormation template.配置 functionbeat 后,使用以下命令导出 CloudFormation 模板。

For Linux and Mac ./functionbeat export function FUNCTION_NAME For Windows .\functionbeat.exe export function FUNCTION_NAME For Linux and Mac ./functionbeat export function FUNCTION_NAME For Windows .\functionbeat.exe export function FUNCTION_NAME

Functionbeat will write the CloudFormation template to standard output or stdout which you can modify if needed. Functionbeat 会将 CloudFormation 模板写入标准 output 或标准输出,您可以根据需要对其进行修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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