Is it possible to add support to give a custom nam...
# help
a
Is it possible to add support to give a custom name to LambdaSubminute's iterator function?
f
You mean setting a custom name for the Lambda function?
Copy code
const targetLabmda = new Function(this, 'targetFunction', {
      code: Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); })'), // It's just a simple function for demonstration purpose only.
      functionName: 'testTargetFunction',
      runtime: Runtime.NODEJS_12_X,
      handler: 'index.handler',
    });
a
@Frank not for the target function. The subminute construct is creating a function called
lambda-subminute-iterator
and if you include lambda subminute in you main stack and deploy that stack to different stages it will try to create that
lambda-subminute-iterator
for each of them and since you already have a function with the same name under that account already then you'll get an error about an already existing resource
A workaround is to move lambda subminute to it's own stack
f
Ah I see.