The count parameter on resources can simplify configurations and let you scale resources by simply incrementing a number.
Additionally, variables can be used to expand a list of resources for use elsewhere.
To run, configure your AWS provider as described in https://www.terraform.io/docs/providers/aws/index.html
Running the example
terraform apply to see it work.