问题
We have a VPC which contains all services and databases used for the testing. We are now planning to setup another such VPC, so that we can have an extra testing env.
Is there a way to export the CloudFormation template from the existing infrastructure ( VPC )?
回答1:
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;
Use deprecated CloudFomer which is part of AWS CFN, you can built templates from your existing resources. Not recommended, just putting in list in case your use-cases are meet with this with less efforts, time and money.
Use former2 a third party tool, which is more reliable than CloudFomer. Please refer this existing thread for more details.
Use N2WS, a third party partnered solution with AWS. Please refer this Blog from AWS.
Use CloudRanger, third party solution knows as Druva.
回答2:
If the existing infrastructure were created using CloudFormation then you can just run the following command:
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.
来源:https://stackoverflow.com/questions/65736413/can-we-export-cloud-formation-template-from-an-existing-vpc