terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 656 forks source link

fix: Workaround to allow ignoring changes to `image_uri` #532

Closed lebenitza closed 5 months ago

lebenitza commented 5 months ago

Description

Duplicated the whole lambda resource in order to have one with:

  lifecycle {
    ignore_changes = [
      image_uri
    ]
  }

This is an workaround to https://github.com/hashicorp/terraform/issues/27360 and would fix:

Motivation and Context

Doing continuous delivery from terraform is a bit tedious. We use lambda with container images but we update those image outside of the terraform state using other toolings and automations.

This kind of workaround already exists in other aws terraform modules.

Breaking Changes

No breaking change. When ignore_image_uri is set to true, it is going to recreate the existing terraform lambda resources!

How Has This Been Tested?

You might not want to accept this at all or in its current form but it might help somebody.

lebenitza commented 5 months ago

Totally understandable. The root issue is 3 years old now, I have no faith is going to be fixed any time soon so I'll keep the fork with this ugly workaround in the meantime.

antonbabenko commented 5 months ago

Yes, we have to have various workarounds for this. Unfortunately.

github-actions[bot] commented 4 months ago

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.