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
892 stars 662 forks source link

policy_name error when setting create_role to false #369

Closed Mrls94 closed 1 year ago

Mrls94 commented 1 year ago

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

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

antonbabenko commented 1 year ago

This issue has been resolved in version 4.4.1 :tada:

github-actions[bot] commented 1 year ago

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.