terraform-aws-modules/terraform-aws-lambda

Creating Lambda fails with "ResourceConflictException: Function already exist:"

patrykko7 opened this issue · 4 comments

Description

We are having an issue with Lambda creation from terraform. The objects are defined in terraform code. Sometimes it happens that pipeline runs and fails with an error

image

First thought was that it returns error because actually object exists with the same name. However after looking into it we are 100% sure object is created within the same run of the pipeline and it is missing in terraform state (it include all tags coming from terraform code and it shows timestamps when it is created - just as other objects from the pipeline). It seems very much like some sync issue where it breaks and it is not added to the state anymore.

Therefore the only solution at the moment it is to delete object manually (since terraform destroy will not fix due to missing it in its own state). Moreover the issue is not deterministic. It cannot be reproduced every time.

Versions

  • Module version [Required]:

  • Terraform version:
    Terraform v1.0.5

  • Provider version(s):
    provider registry.terraform.io/hashicorp/aws v4.12.1
    provider registry.terraform.io/hashicorp/local v2.4.0
    provider registry.terraform.io/hashicorp/null v3.2.1

  • Module version:
    source = "terraform-aws-modules/lambda/aws"
    version = "4.8"

Steps to reproduce the behavior:

Are you using workspaces?
Yes, however issue was reproduced without workspace as well.
Have you cleared the local cache (see Notice section above)?
Yes

Any update on this ?

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

This issue was automatically closed because of stale in 10 days

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.