We are using module terraform-aws-modules/lambda/aws for creating lambda in our environments (Nonprod/common/prod).
Terraform plans shows destroy & recreation of all lambda’s even if there is no change we have specifically done. it is force replacing due to file path / timestamp changes.
Below is the one of the error (error same for all other lambda’s)
-/+ resource “null_resource” “archive” {
~ id = “4667949308722705294” → (known after apply)
~ triggers = { # forces replacement
~ “timestamp” = “1661852603491162000” → “1675943864235205000”
# (1 unchanged element hidden)
}
}
I tried adding environment variable TF_RECREATE_MISSING_LAMBDA_PACKAGE=false but it doesn’t work. shows same terraform plan.
I tried adding recreate_missing_package = false in lambda module (in tfstate current value of recreate_missing_package is true) but still see same terraform plan.
Need help urgently here. We dont want to recreate lambda every time if there aren’t any changes.