claranet / terraform-aws-lambda

Terraform module for AWS Lambda functions
MIT License
157 stars 126 forks source link

list() is deprecated since 0.12 and removed in 0.15 #74

Closed pdecat closed 3 years ago

pdecat commented 3 years ago

Without this change, using this module with terraform 0.15-rc2 fails with the following error:

╷
│ Error: Error in function call
│
│   on .terraform/modules/mymodule.lambda-1/iam.tf line 10, in data "aws_iam_policy_document" "assume_role":
│   10:       identifiers = concat(slice(list("lambda.amazonaws.com", "edgelambda.amazonaws.com"), 0, var.lambda_at_edge ? 2 : 1), var.trusted_entities)
│
│ Call to function "list" failed: the "list" function was deprecated in Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to write a literal list.
╵
╷
│ Error: Error in function call
│
│   on .terraform/modules/mymodule.lambda-1/iam.tf line 26, in locals:
│   26:   log_group_arns            = slice(list(local.lambda_log_group_arn, local.lambda_edge_log_group_arn), 0, var.lambda_at_edge ? 2 : 1)
│     ├────────────────
│     │ local.lambda_edge_log_group_arn is a string, known only after apply
│     │ local.lambda_log_group_arn is a string, known only after apply
│
│ Call to function "list" failed: the "list" function was deprecated in Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to write a literal list.
╵
pdecat commented 3 years ago

Released as v1.3.0.