using ternary condition
This commit is contained in:
parent
fcac3117d1
commit
06950b2c84
1 changed files with 15 additions and 0 deletions
15
project6/base.tf
Normal file
15
project6/base.tf
Normal file
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue