J'ai une ressource comme celle-ci :
resource "yandex_mdb_mysql_cluster" "main" {
+ allow_regeneration_host = false
+ created_at = (known after apply)
+ description = "Multi node MySQL cluster created with Terraform"
+ environment = "PRODUCTION"
+ health = (known after apply)
+ id = (known after apply)
+ labels = {
+ "env" = "dev"
}
+ name = (known after apply)
+ status = (known after apply)
+ version = "5.7"
+ access {
+ data_lens = false
+ web_sql = true
}
+ backup_window_start {
+ hours = 1
+ minutes = 0
}
+ host {
+ assign_public_ip = false
+ fqdn = (known after apply)
+ subnet_id = (known after apply)
+ zone = "ru-central1-a"
}
+ host {
+ assign_public_ip = false
+ fqdn = (known after apply)
+ subnet_id = (known after apply)
+ zone = "ru-central1-b"
}
+ host {
+ assign_public_ip = false
+ fqdn = (known after apply)
+ subnet_id = (known after apply)
+ zone = "ru-central1-c"
}
Maintenant, je veux mettre en place une sortie qui obtient des données à partir de dynamique host
sous forme de carte comme host.zone = host.fqdn
comme :
{ru-central1-a = "fqdn-a"
ru-central1-b = "fqdn-b"
ru-central1-c = "fqdn-c"}
J'ai essayé d'exécuter boucle for sur toute la ressource en prenant host.zone et host.fqdn mais cela ne semble pas fonctionner.... Toute aide est appréciée !