Updating to AWS Provider 3.25.0 issues

After updating to AWS provider 3.25.0 I got the following after exectuing pipeline:

in resource “aws_lambda_function” “lambda_function”:
651 4: resource “aws_lambda_function” “lambda_function” {
655 Error: handler and runtime must be set when PackageType is Zip

Can it be fixed somehow? Probably it is some bug the affect current functionality.

Do you specify those “expected” two parameters? Which version was configured before?

@tbugfinder previously was 2.68.0 version. What “two parameters” you mean?

According to the error handler and runtime are expected (required). Packagetype defaults to zip.

@tbugfinder but they are already specified as:

handler = lookup(var.functions[count.index], "handler", null)
runtime = lookup(var.functions[count.index], "runtime", null)

In that case terraform seems to end up in the default “null”.
Anything wrong with the count ?

@tbugfinder yes, end up in the default “null”.

The main thing is that with version AWS Provider 3.15.0 everything is fine with this part. No issues, no errors. And anything wrong with the count. Probably it somehow related to added Lambda functionality in AWS provider 3.19.0 version that affect all versions after version 3.19.0. It is just assumption, no more.

3.19.0 added lambda container support in aws_lambda_function → Add lambda container image support by bnusunny · Pull Request #16512 · hashicorp/terraform-provider-aws · GitHub
This PR includes above error message.

I’m just wondering if there’s any change if , null is omitted in above code. It might get easier to replay if you’d share more code.

@tbugfinder if null is committed the behaviour is the same:

Error: handler and runtime must be set when PackageType is Zip

     line 4, in resource "aws_lambda_function" "lambda_function":
     4:resource "aws_lambda_function" "lambda_function" {

@tbugfinder and those parameters handler and runtime are already set in Lambda configuration:

locals {
  env_lambdas = [
      name = "compiler_image"
      runtime = "provided"
      handler = "not.needed"

I tried to replay it using source = "git::https://github.com/terraform-aws-modules/terraform-aws-lambda.git?ref=v1.26.0" however wasn’t able to raise the error (I didn’t use lookup functions, though).
Maybe you could provide a repo with a use-case to replay.

@tbugfinder I can assist you with reproducing, because issue is still in present.