Posted On: Nov 19, 2023

Amazon CloudFormation launches a parameter called ImportExistingResources for the CreateChangeSet API that streamlines the process of importing resources into stacks. Customers use ChangeSets to preview the resources that CloudFormation will create, update, or delete during a deployment. Customers can execute ChangeSets if they are satisfied with the preview. ChangeSet execution fails if the names of resources in the template conflict with existing resources. With this launch, customers can create ChangeSets that automatically mark existing resources for an import operation instead of a create operation. This eliminates deployment failures due to naming conflicts. Further, this reduces the manual effort of import operations for use-cases such as stack refactoring.

Today, customers can use the Resource Import feature to import resources into stacks. Resource Import requires customers to provide a list of identifiers for the resources they want to import. This allows customers to import resources that cannot be uniquely identified with their template configuration, such as EC2 instances. But this introduces manual steps during import operations and delays deployments. For example, this can delay customers from rolling back to a previous version of their template when customers delete resources marked with Retain. Customers use the deletion policy of Retain to preserve stateful resources during stack deletions. Customers have to manually import the resources that were retained in a deployment before they can rollback because retained resources cause naming conflicts with the previous template. Now, customers can use ImportExistingResources to automatically import the retained resources during rollbacks. ImportExistingResources allows customers to iterate faster on templates in test environments and use CI/CD actions for critical production deployments.

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

To learn more, see the CreateChangeSet API documentation.