Hello ,
I am facing the errors in TF plan while upgrading from tf 0.11 to tf 0.12
Error: Invalid function argument
on …/…/…/…/resource_module/network/customizable_infosys_vpc/main.tf line 1206, in resource “aws_route53_resolver_rule_association” “this”:
1206: resolver_rule_id = “${flatten(element(compact(concat(var.resolver_rule_ids, list(”“))), count.index))}”
|----------------
| var.resolver_rule_ids is list of list of string with 1 element
Invalid value for “list” parameter: element 0: string required.
Error: Invalid function argument
on …/…/…/…/resource_module/network/customizable_infosys_vpc/main.tf line 1208, in resource “aws_route53_resolver_rule_association” “this”:
1208: name = “${element(compact(concat(var.resolver_rule_ids, list(”“))), count.index)}”
|----------------
| var.resolver_rule_ids is list of list of string with 1 element
Invalid value for “list” parameter: element 0: string required.
Code snippet
This resource module is used in my VPC code.
resource “aws_route53_resolver_rule_association” “this” {
count = “{var.create_rule_association ? var.resolver_rule_count : 0}"
resolver_rule_id = "{flatten(element(compact(concat(var.resolver_rule_ids, list(”“))), count.index))}”
vpc_id = “{aws_vpc.this.id}"
name = "{element(compact(concat(var.resolver_rule_ids, list(”“))), count.index)}”
}
Can anyone help in this topic to fix the errors.