Terraform configuration that installs dummy app in docker containers with prometheus/kibana monitoring
How to use this repository and install a fully working environment with dummy exporter, grafana, kibana, etc?
-
git clone https://github.com/hilafish/terraform-dummy-monitoring.git
-
cd terraform-dummy-monitoring
-
terraform init (make sure you have terraform installed)
-
terraform plan -var 'aws_access_key=access_key_here' -var 'aws_secret_key=secret_key_here' -var 'aws_private_key_path=path_to_private_key_here' -var 'aws_key_name=key_pair_name_here'
(if you want to know what's going to be installed.. it's a good practice to run plan first)
*** region = "us-east-2". If you would like to use other region, change it in the ec2.tf file.
- terraform apply -var 'aws_access_key=access_key_here' -var 'aws_secret_key=secret_key_here' -var 'aws_private_key_path=path_to_private_key_here' -var 'aws_key_name=key_pair_name_here' --auto-approve
*** Reminder: region = "us-east-2". If you would like to use other region, change it in the ec2.tf file.
-
Wait and watch the magic happen or go do some other stuff :)
-
Upon decision to remove the terraform managed resources created just now, run:
terraform destroy -var 'aws_access_key=access_key_here' -var 'aws_secret_key=secret_key_here' -var 'aws_private_key_path=path_to_private_key_here' -var 'aws_key_name=key_pair_name_here' --auto-approve
Once Terraform finished running, you should expect this output:
Apply complete! Resources: 25 added, 0 changed, 0 destroyed.
Outputs: kibana_grafana_public_dns = ec2-3-84-131-190.compute-1.amazonaws.com (for example)
Copy the URL you got.
Grafana:
- browse to http://the_copied_url:3000
- login with user admin, password admin
- you'll be prompt to change the password, please do so.
- If you'll get "unauthorized!" message after login, just refresh the page and it'll get sorted out.
- click on "Home" and then choose the "dummy_exporter_dashboard"
- enjoy viewing the data :)
Kibana:
- browse to http://the_copied_url:5601
- wait a minute or so to allow data to be gathered.
- go to "dashboard"
- click on "Dummy_exporter_dashboard"
- enjoy viewing the data :)