Terraform lookup not working -
i trying lookup map variable gives error. here few snippets of code.
variables.tf
variable "count" { default = 2 } variable "providers" { default = { "0" = "aws" "1" = "aws.west" } }
main.tf
resource "aws_key_pair" "default" { count = "${var.count}" provider = "${lookup(var.providers, count.index)}" .... .... }
output of terraform apply
error configuring: .. error(s) occurred: .... * aws_key_pair.default: provider ${lookup(var.providers, count.index)} couldn't found .... ....
how can resolve ?
nothing wrong syntax here, looks provider not valid parameter aws_key_pair resource, valid pamams (key_name , public_key). https://www.terraform.io/docs/providers/aws/r/key_pair.html
Comments
Post a Comment