From c408ff1baf43226a6393496bdb75ba52090a1402 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Tue, 12 May 2020 11:36:42 +0200 Subject: [PATCH] list in variable --- project2/base.tf | 7 +++++++ project2/terraform.tfstate | 10 +++++++--- project2/terraform.tfstate.backup | 10 +++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/project2/base.tf b/project2/base.tf index 5ff80be..87981d7 100644 --- a/project2/base.tf +++ b/project2/base.tf @@ -2,6 +2,10 @@ variable "a" {} variable "b" { default = "test" } +variable "c" { + type = list + default = ["foo", "bar", "baz"] +} output "ov1" { value = "${var.a}" @@ -9,3 +13,6 @@ output "ov1" { output "ov2" { value = "${var.b}" } +output "ov3" { + value = "${var.c[2]}" +} diff --git a/project2/terraform.tfstate b/project2/terraform.tfstate index a2871ce..cb4e782 100644 --- a/project2/terraform.tfstate +++ b/project2/terraform.tfstate @@ -1,15 +1,19 @@ { "version": 4, "terraform_version": "0.12.24", - "serial": 3, + "serial": 8, "lineage": "53b98038-185e-af43-6c6c-521354912695", "outputs": { "ov1": { - "value": "qsd", + "value": "foobar", "type": "string" }, "ov2": { - "value": "foo", + "value": "bar", + "type": "string" + }, + "ov3": { + "value": "fgh", "type": "string" } }, diff --git a/project2/terraform.tfstate.backup b/project2/terraform.tfstate.backup index 8e64e5e..3beb332 100644 --- a/project2/terraform.tfstate.backup +++ b/project2/terraform.tfstate.backup @@ -1,15 +1,19 @@ { "version": 4, "terraform_version": "0.12.24", - "serial": 2, + "serial": 7, "lineage": "53b98038-185e-af43-6c6c-521354912695", "outputs": { "ov1": { - "value": "aze", + "value": "foobar", "type": "string" }, "ov2": { - "value": "test", + "value": "bar", + "type": "string" + }, + "ov3": { + "value": "baz", "type": "string" } },