Search code examples
amazon-web-servicesaws-cloudformationaws-sdkaws-cdkaws-cloudformation-custom-resource

Cloudformation: Import existing resource


I have used cdk to invoke a custom cloudformation which invokes a lambda. The lambda creates few resources internally. I have used AWS SDK to create these resources. There are some logic before resources are created. This makes it difficult for company ops team to see what exactly is created as a part of the stacks.

I do receive some of the LogicalResourceId, PhysicalResourceId and StackId. Is there any way to import back the resources created in the lambda? Could I use this stackId to stitch the resources created in the lambda back to the cloudformation stack?


Solution

  • There is no automated way for that. You have to manually import those resources, if possible as not all resources can be imported, to CFN. This requires writing all the templates for the resources before hand. Good help with that is former2.