Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename the aws lambda function without changing anything in it

Earlier my function in serverless was:

functions:
    fun:
        handler: file.handler
        name: ${opt:stage, self:provider.stage}-lambda-fun
        environment: ${file(env.yml):${self:provider.stage}.lambda-fun}
        timeout : 180
        memorySize : 1024

I want to change fun with some meaningful name, So I changes it as:

Earlier my function in serverless was:

functions:
    my-fun:
        handler: file.handler
        name: ${opt:stage, self:provider.stage}-lambda-fun
        environment: ${file(env.yml):${self:provider.stage}.lambda-fun}
        timeout : 180
        memorySize : 1024

Now When I deployed this function through serverless, Got the below error:

An error occurred while provisioning your stack: my-funLogGroup - /aws/lambda/lambda-fun already exists

Please help me What I can do more to do this.

like image 236
Rahul Avatar asked Oct 20 '25 18:10

Rahul


1 Answers

Try removing the stack first using serverless remove and then redeploy.

like image 87
Manoj Avatar answered Oct 23 '25 14:10

Manoj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!