Search code examples
amazon-web-servicesaws-cloudformationaws-cli

Use AWS CLI to import existing resources into CloudFormation


I have AWS resources created outside of CF that I want to import into CF. I know how to import existing resources into CF via the AWS dashboard but I want to do it with the CLI.

This is the documentation but I don't see a --resources-to-import option when I run aws cloudformation create-stack help.


Solution

  • In CLI documentation step 4, it's actually calling create-change-set instead of create-stack:

    aws cloudformation create-change-set --change-set-type IMPORT --resources-to-import