Facing error with count.index


I am preparing to deploy Aurora MySQL Cluster, I have defined the following in the “variable.tf” under root:

variable “db_subnet_id” {
type = list
description = “DB Subnet IDs”
default = [“subnet-02ddc8565555aaa9b”,“subnet-1d30f3a41ce19635d”] #db-sub-eu-central-1a , db-sub-eu-central-1b

variable “db-sg” {
type = list
description = “List of standard security groups”
default = [“sg-00cfed28101ea95ab”,“sg-08017f86bc12348e8”,“sg-0e8c67c7a3cd79a79”]

variable “db_az” {
type = list
description = “Frankfurt Availability Zones”
default = [“eu-central-1a”,“eu-central-1b”]

how can I use those variables with the following parameters:

  1. availability_zones
  2. db_subnet_group_name
  3. vpc_security_group_ids

I have tried to use this " availability_zones = var.db_az[count.index] " but the following error shows up:
The “count” object can only be used in “module”, “resource”, and “data” blocks, and only when the “count” argument is set.

please advise, how can I use those variables with those parameters ?