2014-10-14 07:18:45 +02:00
|
|
|
# Count Example
|
|
|
|
|
|
|
|
The count parameter on resources can simplify configurations
|
|
|
|
and let you scale resources by simply incrementing a number.
|
|
|
|
|
2015-01-14 18:28:25 +01:00
|
|
|
Additionally, variables can be used to expand a list of resources
|
2014-10-14 07:18:45 +02:00
|
|
|
for use elsewhere.
|
|
|
|
|
2015-06-01 08:45:01 +02:00
|
|
|
To run, set the environment variables as below with correct values
|
|
|
|
|
|
|
|
export AWS_ACCESS_KEY_ID="..."
|
|
|
|
export AWS_SECRET_ACCESS_KEY="..."
|
|
|
|
export AWS_DEFAULT_REGION="..."
|
|
|
|
|
|
|
|
Alternatively, you can configure the provider configuration where you invoke the module.
|
|
|
|
|
|
|
|
For example, you can use section similar to below.
|
|
|
|
|
|
|
|
# Specify the provider and access details
|
|
|
|
provider "aws" {
|
|
|
|
region = "${var.aws_region}"
|
|
|
|
access_key = "${var.access_key}"
|
|
|
|
secret_key = "${var.secret_key}"
|
|
|
|
}
|
|
|
|
|
|
|
|
Running the example
|
|
|
|
|
|
|
|
run `terraform apply` to see it work.
|