The latest v21 release introduced a bug regarding a value lookup, Invalid index.
Expected behavior
No response
Observed behavior
│ Error: Invalid index
│
│ on .terraform/modules/postgresql/modules/postgresql/main.tf line 47, in locals:
│ 47: database_name = var.enable_default_db ? google_sql_database.default[0].name : (length(local.databases) > 0 ? google_sql_database.additional_databases[0].name : "")
│ ├────────────────
│ │ google_sql_database.additional_databases is object with 10 attributes
│
│ The given key does not identify an element in this collection value. An object only supports looking up attributes by name, not by numeric index.
╵
TL;DR
The latest v21 release introduced a bug regarding a value lookup,
Invalid index
.Expected behavior
No response
Observed behavior
Terraform Configuration
Terraform Version
Additional information
The condition was introduced in https://github.com/terraform-google-modules/terraform-google-sql-db/pull/612/files#diff-5af99345140d405f1b9683608683cd8e45b6cce368ba0446706651ca3a92f041R47