I'm getting this error for any lambda I'm trying t...
# general
I'm getting this error for any lambda I'm trying to create:
Copy code
error: Error creating Lambda function: ResourceConflictException: Function already exist: ****-8d56ff7
      RespMetadata: {
        StatusCode: 409,
        RequestID: "a4e2508b-7d19-43cc-93db-e08b1f64914e"
      Message_: "Function already exist: ***-8d56ff7",
      Type: "User"
I tried using --refresh, recreating the stack, switching to a different account. The lambda is actually created even when this error occur Looking at the AWS cloudtrail events, I see that CreateFunction is called twice, with a 2 min difference(the time it takes to create it). Using the latest pulumi version, anyone knows how to resolve? As a workaround I'm quickly deleting the lambda before the 2nd time it creates it, and that seems to make the pulumi update finish successfully
Could you please provide some of the code you’re using that causes this?
Copy code
import * as aws from '@pulumi/aws';
import { QueueEventSubscription, QueueEvent } from '@pulumi/aws/sqs';
import { lambdaRole } from '../../iam_roles/lambda_role';
const region = aws.config.requireRegion();

const queue = new aws.sqs.Queue('emailNotifications', {
  visibilityTimeoutSeconds: 240
const callback = new aws.lambda.CallbackFunction<QueueEvent, QueueEventSubscription>('emailNotification', {
  role: lambdaRole,
  codePathOptions: {
    extraExcludePackages: ['typescript']
  callback: (e, _context, callback) => {
    const aws = require('aws-sdk');
    const ses = new aws.SES({ region });

    for (let record of e.Records) {
      const { subject, body, from, to } = JSON.parse(record.body);
      console.log('Record:', record.body);
      const params = {
        Destination: {
          ToAddresses: to
        Message: {
          Body: {
            Text: { Data: body }

          Subject: { Data: subject }
        Source: from

      ses.sendEmail(params, function(err, data) {
        callback(err, data);
queue.onEvent('onEmailNotification', callback);

export const emailNotificationQueue = queue;
This is just one component, but it gets the same error when creating the lambda
Thanks — I’ll try to take a look later today
I couldn’t repro this
Running the code, I get just one function creation — is it possible you have this source referenced multiple times?