Skip to content

Existing Lambda used as SQS trigger failing when cdk deploy #7122

@sacag

Description

@sacag

I currently have the stacks deployed using the pre-cdk way i.e. using cloudformation templates. Now, I am using CDK to deploy and I am getting this error
An event source mapping with SQS arn (" ARN of the DLQ") and function (" ARN of lambda function used as a trigger for the DLQ ") already exists. Please update or delete the existing mapping with UUID 2d4bc5c5-9618-40ca-8b0e-799c2d4ec696 (Service: AWSLambda; Status Code: 409; Error Code: ResourceConflictException; Request ID: bfc49114-8929-4382-ad2c-7def9e6edd86)...any idea how to resolve it without deleting the lambda trigger?

Below is the code i have in C#

 MessageErrorProcessorLambdaFunction.AddEventSource(new SqsEventSource(MsgDeadLetterQueue.Queue, new SqsEventSourceProps
            {
                BatchSize = 1
            }));

I tried this too

new EventSourceMapping(this, $"{TopicIdentifier}-EventSourceErrProcessor-Id", new EventSourceMappingProps
            {
                BatchSize = 1,
                Enabled = true,
                EventSourceArn = MsgDeadLetterQueue.Queue.QueueArn,
                Target = MessageErrorProcessorLambdaFunction
            });

Same result

Environment

  • **CLI Version :**1.31
  • Framework Version:
  • OS : Windows
  • Language : C#

Other


This is 🐛 Bug Report

Metadata

Metadata

Labels

@aws-cdk/aws-sqsRelated to Amazon Simple Queue ServicebugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions