Invalid template interpolation value

Hi there ,
I am getting the below error while executing terraform apply
Error: Invalid template interpolation value

│ on main.tf line 247, in resource “null_resource” “Deploy_Web_UI”:
│ 247: “echo ‘search_outbound_subnet=["${var.search_outbound_subnet}"]’ >>$UI_TFVARS_FILE”,
│ ├────────────────
│ │ var.search_outbound_subnet is list of string with 1 element

│ Cannot include the given value in a string template: string required.

MY main.tf file is
“echo ‘user_subnet_name="’"${var.user_subnet_name}"‘"’ >>$UI_TFVARS_FILE”,

247 “echo ‘search_outbound_subnet=["${var.search_outbound_subnet}"]’ >>$UI_TFVARS_FILE”,

Terraform is explaining to you that only strings can be substituted into strings, and a list of string with 1 element is not the same as a string.

Perhaps you want to use the one() function? one - Functions - Configuration Language | Terraform | HashiCorp Developer