From 06950b2c84120cd87572c831742693d6df4dcc3d Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Wed, 13 May 2020 12:49:55 +0200 Subject: [PATCH] using ternary condition --- project6/base.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 project6/base.tf diff --git a/project6/base.tf b/project6/base.tf new file mode 100644 index 0000000..419ca2e --- /dev/null +++ b/project6/base.tf @@ -0,0 +1,15 @@ +variable "doit" {} + +provider "aws" { + region = "eu-west-2" +} + +resource "aws_instance" "instance1" { + count = var.doit == "foo" ? 0 : 2 + ami = "ami-01a6e31ac994bbc09" + instance_type = "t2.micro" + key_name = "cedric" + tags = { + Name = "cedric-instance1" + } +}