Posted On: Feb 18, 2024

Amazon CloudFormation announces a new feature called IaC generator that makes it easy to generate CloudFormation templates and CDK apps for existing cloud resources that are not managed with CloudFormation. You can use the generated templates and apps to import resources into CloudFormation and CDK or replicate resources in a new account. With this launch, you can onboard workloads to Infrastructure as Code (IaC) in minutes. You can then leverage the IaC benefits of automation, scalability, and replicability for these workloads.

Today, you can import resources into CloudFormation by providing a template and a list of resource identifiers. You have to manually create the template by looking up CloudFormation documentation and the live values of resource properties. IaC generator allows you to generate templates by searching and selecting resources in your Amazon Web Services account, eliminating weeks of manual effort. Further, IaC generator recommends related resources for the resources that you select. Related resources, such as S3 buckets and bucket policies, typically belong to the same workload. IaC generator then gives you the option to import resources into CloudFormation, download templates for deployment, or generate a CDK CLI command that converts templates into CDK apps in a programming language of your choice, such as TypeScript or Python. You can copy the command and run it on a host where CDK is installed.

To get started, open the Amazon CloudFormation Console and click on IaC generator in the navigation panel. You can also use IaC generator from the Amazon CLI and SDK. To learn more, see the CloudFormation user guide

IaC generator is available in Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD.