Skip to content

Instantly share code, notes, and snippets.

@tomharrisonjr
Created December 7, 2021 05:14
Show Gist options
  • Save tomharrisonjr/ec878e1ad2cc31449837583c35941b10 to your computer and use it in GitHub Desktop.
Save tomharrisonjr/ec878e1ad2cc31449837583c35941b10 to your computer and use it in GitHub Desktop.
Terraform count as a number
resource "aws_instance" "server" {
count = 4 # create four similar EC2 instances
ami = "ami-a1b2c3d4"
instance_type = "t2.micro"
tags = {
Name = "Server ${count.index}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment