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
885 stars 658 forks source link

feat: Allow ignoring changes in image_uri #552

Closed atorrescogollo closed 3 months ago

atorrescogollo commented 3 months ago

Description

Allow to a rollout the image_uri (from a different place, e.g: Jenkins, GitHub Actions, etc) without requiring you to update the terraform code.

Unfortunately, I don't think there is a way to parametrize the ignore_changes field. Though, I wrote a feature request to opentofu to try to address this:

Motivation and Context

I want to create the lambda so that it targets to latest tag by default and I have always something that runs. However, when I make a change that only concerns to the code, I don't need to run terraform (which has all the dependencies for the lambda). I just want to change the image_uri to target the newly created image (even with aws-cli).

Breaking Changes

How Has This Been Tested?

antonbabenko commented 3 months ago

I understand this PR's reasoning but don't like the code duplication because it significantly increases the maintenance cost.

Unfortunately, I don't see a way to merge this as-is. I suggest that you deploy as you do and change the value via Terraform configuration to avoid the revert.

atorrescogollo commented 3 months ago

Ok, I understand. I uploaded this PR because I saw the same issue in the secrets-manager module: https://github.com/terraform-aws-modules/terraform-aws-secrets-manager/blob/v1.1.2/main.tf#L92-L116 . But I get that here is way more maintenance. I think I'll have to maintain it in my fork.

Then, we'll see if eventually this can be an opentofu feature instead. I post the issue link in case someone wants to support this feature by putting a πŸ‘ in the opentofu issue :

github-actions[bot] commented 2 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.