Is it possible to use my own custom naming scheme ...
# help
i
Is it possible to use my own custom naming scheme for Lambda functions deployed using SST?
The names of my functions are long, and they get truncated when using SST to deploy which means that often times, my functions look similar in their lambda names and I have to look carefully to find the right function
t
You can override the automatic name and we provide a callback as well. But I haven't cared about it as much with the new console - have you tried it?
Console shows functions by ID
j
Just leaving a note here for @Frank, we should document this better.
i
Can you lead me to the docs or anything explaining this better? Really getting hard to track now with the weird naming
f
Hey @Iamgingertrash you can specify the function names like this:
Copy code
new Function(this, "MyFunction", {
  functionName: app.logicalPrefixName("my-function"),
  handler: "src/lambda.main",
});
by using
app.logicalPrefixName
it prefixes the function name with stage name and the app name. You can read more about it here https://docs.serverless-stack.com/constructs/App#logicalprefixedname
i
Ty, where does this snippet belong? In the app file? Or stack?
t
What format are you trying to have for your function name?
this example you'd have to do it function by function
i
Trying to just use the handler name as the function name
t
Curious what you're looking in the aws console for?
i
For eg one of our endpoints is /propagate_polygon_snark_transaction
And we have others with the same “propagate” in it
And always have to guess which is which
Cause it's truncated in the aws console
t
If this is with the api construct you'll need to do it per function eg
Copy code
"GET /thing": {
  handler: "./myfunc",
  functionName: app.logicalPrefixName("my-function"),
}