<https://docs.aws.amazon.com/lambda/latest/dg/API_...
# general
n
Hey Kuda, you definitely can 🙂, I think there is a few ways to go about it, but use the object when defining my lambda and set the property
functionName
it might look something like the following
Copy code
'GET  /': {
  functionName: 'MyFunction',
  function: `<SRC_PATH>/get.main`,
},
f
Thanks @Noah D, minor tweak:
Copy code
'GET  /': {
  function: {
    handler: `<SRC_PATH>/get.main`,
    functionName: 'MyFunction',
  }
},
k
@Kuda Zhou There is also a perhaps more generic way, which uses the fact that the names get prefixed by the App construct. We used the approach below to put the stage after the normal prefix instead of having it in front like SST does by default. This could also be used for stuff like a super short prefix, length checks + then limiting prefixes ... What's a bit annoying though s that CDK always adds it's own random ids ad the end to all names, but that is AWS's lazy approach to ensure name uniqueness for CDK and it's related to SST.
@thdxr @Frank How would you feel about subclassing the CDK resource naming function as SST already has it's own mechanism for unique names (stack-prefix-logical name)? I'm not sure how valuable the random extension is in such case.
t
We've had this discussion before and I can't remember exactly why we couldn't do this let me think