aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

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

Open
#2,075 1 comment 2 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report by creating 10–15 stacks in parallel, each with 10–15 Lambda functions, and inspect CloudTrail for duplicate CreateFunction calls. The issue provides no repository files, tests, or implementation entry point; done would require the reported duplicate creation failure to be resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.