Skip to content

Instantly share code, notes, and snippets.

@valery-zhurbenko
Created May 1, 2020 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valery-zhurbenko/e6189941a239dec8bf51763f86826ed8 to your computer and use it in GitHub Desktop.
Save valery-zhurbenko/e6189941a239dec8bf51763f86826ed8 to your computer and use it in GitHub Desktop.
variable create_web_vm {
default = false
}
resource "aws_instance" "web" {
### If create_web_vm variable is "true" - one aws_instance.web resource will be created. If false create zero aws_instance.web resources
count = "${var.create_web_vm ? 1: 0}"
ami = "AL2_x86_64"
instance_type = "t2.micro"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment