Any ideas why when I pass a name to `aws.lambda.Fu...
# aws
l
Any ideas why when I pass a name to
aws.lambda.Function()
that name gets used exactly when the lambda is spun up, but when I pass a name to
aws.lambda.CallbackFunction()
a hash is appended to the end of the name? For example if I pass
test-callback
to the callback function, the lambda spun up from the callback function will be something like
test-callback-9283a32
g
Do you have a snippet of code that you can share? Generally, Pulumi does auto-naming that adds that suffix (
-9283a32
) to avoid a collision on resource names unless you explicitly pass in a
name
value alongside the
id
; that
name
value will override the physical name. So I'm guessing that the
name
property isn't available for the callback function resource where it is available for the function resource. I'll be able to point to specific spots if you've got a snippet to share.
l
ahh yeh so for the callback I do
Copy code
let callback = new aws.lambda.CallbackFunction(name, {
            memorySize: 128 /*MB*/,
            timeout: 60,
            runtime: "nodejs14.x",
            callback: async (e) => {
                
            },
            
            role: this.lambdaExecRole,
        });
and for the function I do
Copy code
let createdFunction = new aws.lambda.Function(physicalName, lambdaConfig, {
            dependsOn: [cloudwatchGroup],
        });
i assumed the first function param
name
would be what you're mentioning. We do pass in names in both cases. If i pass in a name+hash to the
function
call, it uses it as is, but in the
callbackfunction
it appends another hash as well