Example of detecting logs when Web server outputs Server Error, pushing to OCI streaming, and monitoring with monitoring visualization tool (Grafana)
- 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
- Provision Environments
$ terraform apply -var 'provision=true'
- Run auto web requests (return 502 Error)
$ terraform apply -var 'exec_web_request=true'
-
Check Monitoring, Alarm Status and Grafana Dashboard
-
Clean environments
$ terraform destroy