The list() and map() functions were removed in Terraform 0.15
Removed. The source gives no day. Replacement: tolist([ … ]) for list(), tomap({ … }) for map(). Source: Terraform 0.15 upgrade guide: legacy configuration language features.
Check a version:
evergreen check pkg:generic/terraform
Terraform v0.12 replaced the list() and map() functions with first-class [ … ] and { … } syntax, and the v0.15 upgrade guide states that the deprecated functions were removed in v0.15. Replace list(a, b) with tolist([a, b]) and map(k, v) with tomap({ k = v }); because Terraform can usually infer the type from context, the bare [ … ] and { … } forms often work without the conversion. The list(string) and map(string) type constraints are different and remain valid.
Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>
| Status | Removed |
| Severity | high |
| Ecosystem | terraform |
| Component | pkg:generic/terraform |
| Affected versions | vers:semver/>=0.15.0 |
| Date from the source | The source gives no day |
| Replacement | tolist([ … ]) for list(), tomap({ … }) for map() |
| Evidence last seen | 2026-10-31 |
| Reviewed | 2026-10-31 by arminazimi |
| Review due | 2027-01-29 (90 days after the last review) |
| Rule ID | terraform.function.list-map |
Sources
- Terraform 0.15 upgrade guide: legacy configuration language features (accessed 2026-10-31)
- Terraform tolist function (accessed 2026-10-31)
- Terraform tomap function (accessed 2026-10-31)
Migration
Constraints
- Do not rewrite a type constraint:
type = list(string)andtype = map(object({...}))are type constructors that still exist in Terraform 0.15 and later. - Rewrite a call only when every argument is on one line and the argument count is meaningful: list() needs at least one value, and map() needs an even number of key/value arguments.
- In a map() call, write each key as an identifier or a quoted string; a bare expression key does not have the same meaning in an object constructor.
Steps
- Replace the removed calls. Change
list(a, b)totolist([a, b])andmap("k", v)totomap({ k = v }). When the surrounding context already fixes the type, the bare[a, b]and{ k = v }forms are also correct. - Find the calls left in other files. Search *.tf for
list(andmap(outside variable type constraints, and rewrite the value calls the same way. Leavelist(string),map(string), and other type constructors unchanged.
Verification
terraform init -backend=false && terraform validate: Initialize without touching remote state and check that no removed function is left.terraform plan: Confirm the collection types and values are unchanged apart from the rewrite.
Detected by
The terraform detector. See Detectors and Compatibility.
Related
Same ecosystem
- AKS 1.28 and earlier are no longer supported
- AKS 1.29 is past long-term support
- AKS 1.30 is past long-term support
- AKS 1.31 is past its 12-month support window
- AKS 1.32 is past its 12-month support window
- AKS 1.33 is past its 12-month support window
- Terraform CLI 1.10 is no longer a supported release line
- Terraform CLI 1.11 is no longer a supported release line
Data
This page is generated from registry/terraform.json, rule terraform.function.list-map, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.
Last updated