Example of setting the CPU threshold and executing Auto Scaling when the threshold is exceeded, and at the same time firing an Alarm trigger and sending an email notification
- Set env-vars In this file, you should write necessary information (like below) in order to build cloud environments by terraform.
- User Credentials (user_ocid, fingerprint ..etc)
- Region
- ssh_key files
- and so on...
env-vars-sample is a good exaple.
- Load env-vars
$ source env-vars
- Run Terraform
# Init
$ terrafrom init
# Plan
$ terraform plan
# Apply
$ terraform apply
- Run CPU Load test
$ terraform apply -var 'exec_cpu_load=true'
-
Check Monitoring, Alarm Status and Auto Scaling history
-
Clean environments
$ terraform destroy