It looks like you’ve tried to use template syntax and a function inside the definition of
cidr_blocks. That isn’t supported, but it also isn’t necessary for your situation here because the cidr block list is already defined in the expected list constructor syntax, so you can pass it directly.
I see you running
terraform.exe which makes me suspect you are using Windows, but you are also using Unix-style shell quoting so I suppose you are using a Unix shell ported to Windows? In which case, I think the following syntax should work, using double quotes because otherwise we can’t use shell interpolation of
terraform.exe apply -var "VPC_id=vpc-05a5f975e4" -var "subnet_id=subnet-0455cef4f" -var "ami_id=ami-0d9ba49d82" -var "cidr_blocks=$cidr"
Note that the
$cidr here is interpreted by the shell, not by Terraform. Terraform will just see the value of that variable pasted in there exactly as you wrote it, without knowing it came from a shell variable.
If you are using the Windows command interpreter or PowerShell then you might need to use slightly different syntax, but the general idea is to use the shell interpolation to insert the value before Terraform even runs, rather than expecting Terraform to evaluate the argument as a Terraform template.