# h53 provisioner 

## Intro
This scripts use Terraform and Bash to provision an h53 service. 
Actually they are committed in this git project but they can be moved in a specific git project, so they can be used in other smartkits avoiding code duplication. See: https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d

All variables to be set can be found in variables.tf. Terraform and Bash uses the variables values defined in an external configurable file with tfvars extension (var-file prop).

## Standard commands

To provision:

    pre-apply.sh --var-file="{tfvars.file.path}"
    terraform init
    terraform apply --var-file="{tfvars.file.path}"
    
To destroy:

    terraform init
    terraform destroy --var-file="{tfvars.file.path}"
    post-destroy.sh --var-file="{tfvars.file.path}"    

## Useful scripts

### Configuring configuration.properties

With this script you can set some pre calculated variables into h53 configuration.properties file:

    confAppVars.sh --var-file="{tfvars.file.path}"

### Check destroy

With this script you can check if destroy was correctly performed:

	check_destroy --var-file="{tfvars.file.path}"

### Service

To stop service:

	service stop --var-file="{tfvars.file.path}"

To start service:

	service stop --var-file="{tfvars.file.path}"
	
To status service:	

	service status --var-file="{tfvars.file.path}"







