I have created a serverless .Net core API. Lambda function is created using a console. Now I want to use the same lambda when publishing. But cloud formation is creating a new lambda function when deploying. Is it possible to define the same lambda function in cloud formation template?
Here is the template used for publishing
`{
"AWSTemplateFormatVersion": "2010-09-09",
"Transform": "AWS::Serverless-2016-10-31",
"Description": "An AWS Serverless Application that uses the ASP.NET Core
framework running in Amazon Lambda.",
"Resources": {
"testapi": {
"Type": "AWS::Serverless::Function",
"Properties": {
"FunctionName" : "arn:aws:lambda:ap-south-
1:721092682477:function:testapi",
"Handler": "Syngenta.Global.TPTool.WebApi::Syngenta.Global.TPTool.WebApi.LambdaEntryPoint
::FunctionHandlerAsync",
"Runtime": "dotnetcore2.1",
"CodeUri": "",
"MemorySize": 512,
"Timeout": 30,
"Role": null,
"Policies": [
"AWSLambdaFullAccess"
],
"Environment": {
"Variables": {
}
},
"Events": {
"ProxyResource": {
"Type": "Api",
"Properties": {
"Path": "/{proxy+}",
"Method": "ANY"
}
}
}
}
}
}
}`
here testapi is the lambda function which is already created using AWS console. when publishing getting the error "function name already exists". And if name is changed then new lambda function is created.