8627d5eb by Volodymyr Tsap

A small refactor

1 parent b5a5a554
......@@ -5,7 +5,7 @@
3. Created variable files: terraform.tfvars, variables.tf
4. Example for list element selection in *vpc_security_group_ids*
5. Example for map element lookup in *instance_type*
6. Add metadata variable count
```
# setup your AMS access parameters in ~/.aws
......
# Sample2. Creating ubuntu instance using set of files
1. Build custom image using packer. Build/redeploy workflow
2. Deploy a sample application using *user_data*
3. Create RDS MySQL database, pass db endpoint to application
4. Adding outputs
```
# setup your AMS access parameters in ~/.aws
# Init terraform
terraform init
# Create instance
terraform apply
```
# Sample4. Using funtions and count hints
1. Moving deployment script into temlplate provider
2. Using *length()* function to get size and create multiple resources
```
# setup your AMS access parameters in ~/.aws
# Init terraform
terraform init
# Create instance
terraform apply
```
## Define provider
provider "aws" {
region = "${var.region}"
}
# Template for initial configuration bash script
data "template_file" "init" {
template = "${file("init.tpl")}"
template = "${file("files/init.tpl")}"
count = "${length(var.instance_suffix)}"
vars {
......
## Define provider
provider "aws" {
region = "${var.region}"
}