From ec141361797a82e447e3a56f1f70258ed298b4c8 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Tue, 12 May 2020 11:49:29 +0200 Subject: [PATCH] variables map --- project2/base.tf | 11 +++++++++++ project2/terraform.tfstate | 8 ++++++-- project2/terraform.tfstate.backup | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/project2/base.tf b/project2/base.tf index 87981d7..d0248f5 100644 --- a/project2/base.tf +++ b/project2/base.tf @@ -6,6 +6,14 @@ variable "c" { type = list default = ["foo", "bar", "baz"] } +variable "d" { + type = map + default = { + "foo" = "bar" + "aze" = "rty" + "qsd" = "fgh" + } +} output "ov1" { value = "${var.a}" @@ -16,3 +24,6 @@ output "ov2" { output "ov3" { value = "${var.c[2]}" } +output "ov4" { + value = "${var.d.foo}" +} diff --git a/project2/terraform.tfstate b/project2/terraform.tfstate index cb4e782..1901a28 100644 --- a/project2/terraform.tfstate +++ b/project2/terraform.tfstate @@ -1,7 +1,7 @@ { "version": 4, "terraform_version": "0.12.24", - "serial": 8, + "serial": 9, "lineage": "53b98038-185e-af43-6c6c-521354912695", "outputs": { "ov1": { @@ -13,7 +13,11 @@ "type": "string" }, "ov3": { - "value": "fgh", + "value": "baz", + "type": "string" + }, + "ov4": { + "value": "bar", "type": "string" } }, diff --git a/project2/terraform.tfstate.backup b/project2/terraform.tfstate.backup index 3beb332..cb4e782 100644 --- a/project2/terraform.tfstate.backup +++ b/project2/terraform.tfstate.backup @@ -1,7 +1,7 @@ { "version": 4, "terraform_version": "0.12.24", - "serial": 7, + "serial": 8, "lineage": "53b98038-185e-af43-6c6c-521354912695", "outputs": { "ov1": { @@ -13,7 +13,7 @@ "type": "string" }, "ov3": { - "value": "baz", + "value": "fgh", "type": "string" } },