Based on our Infrastructure as Code (IaC) experience at Binbash (https://www.binbash.com.ar) we found several ways to translate existing manually deployed (from Web Console UI) AWS infra to Cloudformation (CF) and / or Terraform (TF) code.
Introduced feature (since Nov 2019) that allows to Import existing resources into a CloudFormation stack
$aws service_name_here describe for each element that make up your stack, eg for RDS Database Stack:
- RDS Instance ->
- RDS (EC2) SG ->
- RDS Subnet Group ->
- RDS DB Param Group ->
Afterwards manually translate to CF based on the outputs obtained from the
aws cli for each of the components. This approach usually requires more experience in both AWS and CF, but the templates that you are creating can be structured and designed under best practices, fully parameterized (
Sub, Ref, Join, Fn::GetAtt:, Fn::ImportValue), modular, applying
conditions . As a result your 1st iteration would probably be close to the final state of the templates
Very interesting reference examples: https://github.com/widdix/aws-cf-templates/
Map your reality, don't waste time producing static documentation that is outdated as soon as you publish.
Cloudcraft Live instantly analyzes all the service relationships of your AWS environment, and reverse engineers a complete system architecture diagram.
Their powerful auto-layout and advanced AWS account scanning capabilities are also available to you as an API. Then via the "Terraform code export" (https://modules.tf/) will be generating infrastructure as Terraform configurations from visual diagrams created using Cloudcraft.
With https://brainboard.co you could import your cloud infrastructure
and turn AWS environments into actionable visual Terraform infrastructure-as-code IaC.
They named this feature as "Terraform Reverse" , which allows users to import an infrastructure from your cloud credentials. :ledged: NOTE: This feature is in Beta and will be released soon for everyone.
The complete doc could be found here https://docs.brainboard.co/start/import-infrastructure