aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

[AWS::Lambda::Function] - [BUG] - Lambda creation through Cloudformation sometimes fails with resource exists #2075

Open arshikam opened 1 week ago

arshikam commented 1 week ago

Name of the resource

AWS::Lambda::Function

Resource Name

No response

Issue Description

When creating multiple lambda functions simultaneously, the creation sometimes fails with below error:

Resource handler returned message: "Function creation failed because the function already exists" 

Expected Behavior

Lambda with the same name does not exist in the account, however it stills fails with function exists error

Observed Behavior

Upon checking Cloudtrail it was found that CFN is sometimes making 2 'CreateFunction' API calls for the same lambda. First one is getting successful however the second call is failing with above error.

Test Cases

Try creating 10-15 stacks in parallel. Each with an average of 10-15 lambdas.

Other Details

As per AWS Support, there is an internal bug. So creating this github issue to track this publicly.

Note: Sequential deployment of the stacks and using DependsOn is not suitable for our use case.