Skip to content

Call to function "list" failed: the "list" function was deprecated in Terraform v0.12 #20

@kenotsolutions

Description

@kenotsolutions

terraform plan gives below error.
required_version = ">= 0.15.4"

Error: Error in function call

│ on .terraform/modules/codedeploy/app/codedeploy.tf line 59, in resource "aws_iam_policy" "deployer_policy":
│ 59: ${element(formatlist(", { "Effect" : "Allow", "Action" : [ "s3:PutObject*", "s3:ListBucket" ], "Resource" : [ "%s/", "%s" ] }, { "Effect" : "Allow", "Action" : [ "s3:ListAllMyBuckets" ], "Resource" : [ "" ] }", compact(list(var.s3_bucket_arn)), compact(list(var.s3_bucket_arn))), 0)}
│ ├────────────────
│ │ var.s3_bucket_arn will be 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.


│ Error: Error in function call

│ on .terraform/modules/codedeploy/app/codedeploy.tf line 59, in resource "aws_iam_policy" "deployer_policy":
│ 59: ${element(formatlist(", { "Effect" : "Allow", "Action" : [ "s3:PutObject*", "s3:ListBucket" ], "Resource" : [ "%s/", "%s" ] }, { "Effect" : "Allow", "Action" : [ "s3:ListAllMyBuckets" ], "Resource" : [ "" ] }", compact(list(var.s3_bucket_arn)), compact(list(var.s3_bucket_arn))), 0)}
│ ├────────────────
│ │ var.s3_bucket_arn will be 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions