I am upgrading from tf 11 to tf 12. I've run into the issue where terraform plan produces the following error:
Error: Incorrect attribute value type
4: subnets = ["${var.alb_subnets}"]
Inappropriate value for attribute "subnets": element 0: string required.
The code snippet for this error is:
resource aws_alb "alb" {
name = "ecs-${var.app_name}"
internal = "${var.internal}"
subnets = ["${var.alb_subnets}"]
security_groups = ["${var.security_groups}"]
count = "${var.do_module}"
}
If anyone can help me with this I would appreciate it.
Change subnets = ["${var.alb_subnets}"] to subnets = var.alb_subnets
Its a update in terraform v0.12
Reference: https://www.terraform.io/upgrade-guides/0-12.html#referring-to-list-variables
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With