是否可以重命名AWS Lambda函数?

时间:2022-08-14 18:52:34

I have created some Lambda functions on AWS for testing purposes (named as test_function something), then after testing I found those functions can be used in prod env.

我在AWS上创建了一些Lambda函数用于测试目的(命名为test_function),然后在测试后我发现这些函数可以在prod env中使用。

Is it possible to rename the Lambda function? and how? Or should I create a new one and copy paste source code?

是否可以重命名Lambda函数?如何?或者我应该创建一个新的并复制粘贴源代码?

1 个解决方案

#1


42  

The closest you can get to renaming the lambda function is using an alias, which is a way to name a specific version of a lambda. The actual name of the function though, is set once you create it. If you want to rename it, just create a new function and copy the exact same code into it. It won't cost you any extra to do this (since you are only charged for execution time) so you lose nothing.

最接近重命名lambda函数的是使用别名,这是一种命名特定版本lambda的方法。但是,函数的实际名称会在您创建后设置。如果要重命名它,只需创建一个新函数并将完全相同的代码复制到其中。这样做不会花费你额外费用(因为你只收取执行时间),所以你什么都不会丢失。

For a reference on how to name versions of the lambda function check out the documentation here.

有关如何命名lambda函数版本的参考,请查看此处的文档。

#1


42  

The closest you can get to renaming the lambda function is using an alias, which is a way to name a specific version of a lambda. The actual name of the function though, is set once you create it. If you want to rename it, just create a new function and copy the exact same code into it. It won't cost you any extra to do this (since you are only charged for execution time) so you lose nothing.

最接近重命名lambda函数的是使用别名,这是一种命名特定版本lambda的方法。但是,函数的实际名称会在您创建后设置。如果要重命名它,只需创建一个新函数并将完全相同的代码复制到其中。这样做不会花费你额外费用(因为你只收取执行时间),所以你什么都不会丢失。

For a reference on how to name versions of the lambda function check out the documentation here.

有关如何命名lambda函数版本的参考,请查看此处的文档。