Hello Everyone,
I am getting below error when executing terraform plan for Production workspace:
│ Error: Invalid index
│ on main.tf line 21, in locals:
21: aws_clause = "(region LIKE '${var.prod_region[terraform.workspace]}' OR aws.region LIKE '${var.prod_region[terraform.workspace]}' OR tags.ProdRegion LIKE '${var.prod_region[terraform.workspace]}' OR ProdRegion LIKE '${var.prod_region[terraform.workspace]}' OR label.ProdRegion LIKE '${var.prod_region[terraform.workspace]}') AND (aws.accountId = '${var.aws_acct_id[terraform.workspace]}' OR tags.accountId = '${var.aws_acct_id[terraform.workspace]}') SINCE 7 DAYS AGO TIMESERIES"
| terraform.workspace is "Prod"
| var.prod_region is "{\"Prod\":\"eu-central-1\"}"
This value does not have any indices.
I am not getting what’s wrong here, though when I tried manual hard coded values instead of above variables in clause, it works well!
Please advise.
Thanks!