There is something that I don't understand in the concept of Cloudformation import feature.
I have a Lambda function, lets call it "myLambdaFunc". "myLambdaFunc" is running and working.
Now I want to create a cloudFormation-stack to deploy the same Lambda.
So I followed this article - "Bringing Existing Resources Into CloudFormation Management".
My cloud formation file look like this:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources" : {
"LambdaImportTest2" : {
"Type" : "AWS::Lambda::Function",
"DeletionPolicy" : "Delete",
"Properties" : {
}
}
}
}
But when trying to run the import in cloudFormation I get an "IMPORT_FAILED" error, because "Property Handler cannot be empty."
The error makes sense because the Property is empty.
But this is where my confusion starts - I try to import an existing Lambda. I don't want to define a new Lambda.. So what should I put in the Property handler? what code should I set there?