I will like to create resources on AWS using patterns from a variable in terraform.
For example:
proyects = ["proyect1/X", "proyect1/Y", "proyect2/X", ...]
resource "aws_example" "proyect1" {
count = length(var.proyects) <-- only using the proyect1/... ones
name = var.proyects[count.index] <-- only using the proyect1/... ones
resource proyect1/X created
resource proyect1/Y created
resource "aws_example" "proyect2" {
count = length(var.proyects) <-- only using the proyect2/... ones
name = var.proyects[count.index] <-- only using the proyect2/... ones
resource proyect2/X created
resource proyect2/Y created
I don't know if this is possible...I'm trying using https://www.terraform.io/docs/language/functions/index.html