JJ Teoh
12/10/2021, 6:35 AMconst stackALambda = new sst.Function(this, 'DoSomething', {
handler: 'path/to/doSomething.handler',
runtime: lambda.Runtime.NODEJS_14_X,
})
When run sst start
, in my aws console, I saw a lambda function name 'my-project-DoSomethingdlsfinksd' .
If I redeploy the lambda function name will change again.
I have another lambda that will invoke this lambda function, how can I get the function name dynamically.
In another lambda function(in another dedicated stack), I need to get the function name dynamically so I don't have to change the name whenever DoSomething update:
await lambda
.invoke({
FunctionName: `DoSomething`, // <-- this will throw resource not found. how to get the formatted function name dynammically?
Payload: JSON.stringify({
data: "data"
}),
InvocationType: 'RequestResponse',
})
.promise()
Mayowa
12/10/2021, 12:50 PMHamed Mamdoohi
12/10/2021, 1:45 PMHamed Mamdoohi
12/10/2021, 1:46 PMHamed Mamdoohi
12/10/2021, 1:47 PMJJ Teoh
12/15/2021, 3:37 AM