Generate templates from existing resources with IaC generator - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Generate templates from existing resources with IaC generator

With the CloudFormation infrastructure as code generator (IaC generator), you can generate a template using Amazon resources provisioned in your account that are not already managed by CloudFormation.

The following are benefits of the IaC generator:

  • Bring entire applications under CloudFormation management or migrate them into an Amazon CDK app.

  • Generate templates without having to describe a resource property by property and then translate that into JSON or YAML syntax.

  • Use the template to replicate resources in a new account or Region.

The IaC generation process consists of the following steps:

  1. Scan resources – The first step is to start a scan of your resources. This scan is region-wide and expires after 30 days. During this time, you can create multiple templates from the same scan.

  2. Create your template – To create the template, you have two options:

    • Create a new template from scratch and add the scanned resources and related resources to it.

    • Use an existing CloudFormation stack as a starting point and add the scanned resources and related resources to its template.

  3. Import resources – Use your template to import the resources as a CloudFormation stack or migrate them into an Amazon CDK app.

The IaC generator feature is available in all commercial Regions and supports many common Amazon resource types. For a full list, see Resource type support.

Considerations

You can generate JSON or YAML templates for Amazon resources published to the CloudFormation registry, for resources for which you have Read permissions. The templates for the IaC generator capability models cloud resources reliably and quickly without having to describe a resource property by property.

The following table lists the quotas available for the IaC generation feature.

Name Value

Maximum number of resources that can be processed in an account scan

100000

Number of scans per day (for accounts with less than 10,000 resources)

3

Number of scans per day (for accounts with more than 10,000 resources)

1

Concurrent number of templates generating per account

5

Concurrent number of resources modeled for one template generation.

5

Total number of resources that can be modeled in one template

500

Maximum number of generated templates per account

1,000

Important

IaC generator only supports resources that are supported by Cloud Control API in your Region. For more information, see Determining if a resource type supports Cloud Control API in the Cloud Control API User Guide

Commonly used commands for template generation, management, and deletion

The commonly used commands for working with IaC generator include:

Migrate a template to the Amazon CDK

The Amazon Cloud Development Kit (Amazon CDK) is an open-source software development framework that you can use to develop, manage, and deploy CloudFormation resources using popular programming languages.

The Amazon CDK CLI provides an integration with IaC generator. Use the Amazon CDK CLI cdk migrate command to convert the CloudFormation template and create a new CDK app that contains your resources. Then, you can use the Amazon CDK to manage your resources and deploy to CloudFormation.

For more information, see Migrate to Amazon CDK in the Amazon Cloud Development Kit (Amazon CDK) Developer Guide.