DDB Streams Event Source Mapping Already Exists Error

When updating a lambda with a DynamoDB Streams event source I got a mapping already exists error

Error

1
2
10:54:08 AM | CREATE_FAILED | AWS::Lambda::EventSourceMapping | *
Resource handler returned message: "The event source arn * and function * provided mapping already exists. Please update or delete the existing mapping with UUID *.

Resolution

Check if your CDK Metadata path has changed. Changing the stack or construct logical ID will change the metadata path.

If the logical ID change was intentional, manually delete the mapping and redeploy.

More Info

When the path changes CDK attempts to replace the mapping. Since CloudFormation must create a new resource before deleting the old, this threw a mapping already exists error.

In my case, I changed the stack logical ID, which triggered a replacement on the event source mapping.

Share