terraform-aws-modules/terraform-aws-lambda

policy_name error when setting create_role to false

Mrls94 opened this issue · 2 comments

Description

After update in the module our pipelines are failing. With the error:
│ Error: Error in function call

│ on .terraform/modules/lambda_function/iam.tf line 15, in locals:
│ 15: policy_name = coalesce(var.policy_name, local.role_name)
│ ├────────────────
│ │ local.role_name is null
│ │ var.policy_name is null

│ Call to function "coalesce" failed: no non-null, non-empty-string arguments.

When calling the module we set the create_role variable to false.

When pinning the version of the module to 4.2.1 it works

Versions

  • Module version: 4.4.0

  • Terraform version:
    v1.1.5

  • Provider version(s):
    provider registry.terraform.io/hashicorp/aws v4.37.0
    provider registry.terraform.io/hashicorp/external v2.2.2
    provider registry.terraform.io/hashicorp/local v2.2.3
    provider registry.terraform.io/hashicorp/null v3.2.0

Reproduction Code [Required]

module "lambda_function" {
source = "terraform-aws-modules/lambda/aws"
version = "4.4.0"

function_name = "somename"
description = "some description"
handler = "index.handler"
runtime = "nodejs16.x"

create_role = false

publish = true
}

Steps to reproduce the behavior:

terraform init && terraform apply

This issue has been resolved in version 4.4.1 🎉

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.