# Dynatrace onboarding repo / Terreform config This repository holds the Dynatrace configuration for onboarding purposes # Prerequisites ## Python packages Before executing scripts, python requirements have to be satisfied. To do so, execute following command: pip install -r requirements.txt # Instructions 1. Clone template: git clone --branch template https://atc.bmwgroup.net/bitbucket/scm/opapm/coco_apm_terraform_onboarding.git 2. Change directory: cd coco_apm_terraform_onboarding 3. Create branch: git checkout -b CD_ 4.Install python dependencies: pip install -r requirements.txt 5.Run onboarding script: 4.1 Default implementation (Management zone, Alerting profile and predefined dashboard) python ./onboarding.py -A CD_ -C 4.2 Additional features (see Usage section): python ./onboarding.py -A CD_ -C -F 6. Review created files: git status 5.1 Adjust additional feature files (if generated with "-F" option). See "Adjusting tf files" section 7. Commit your changes: git add git commit -m " - Add initial configuration of application to Dynatrace" git push -u origin CD_ 8. Create pull request from CD_ to master # Adjusting tf files For more information about adjusting tf files to your need please follow: 1. Management zones: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/management_zone 2. Alerting profiles: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/alerting 3. Dashboards: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/dashboard 4. Custom service: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/custom_service 5. Notification: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/notification 6. Process group naming: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/processgroup_naming 7. Service naming: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/service_naming # Usage usage: onboarding.py [-h] -A APPNAME -C COMPASSID -F FEATURES Generate predefined Dynatrace configuration via Terraform. Default features are Management zone, Alerting profile and predefined dashboard. For more see options below options: -h, --help show this help message and exit -A APPNAME, --appname APPNAME Your app_name (default: None) -C COMPASSID, --compassid COMPASSID Your compass_id (default: None) -F FEATURES, --features FEATURES Comma separated additional features. Possible options are: custom_service,processgroup_naming,service_naming (default: None) # Files ## _templates folder Please do not change template files inside this folder. If any of this files will be changed, your pull request will be rejected. ## onboarding.py This scripts generates predefined configuration basing on your app_name and compass ids ## requirements.txt File containing required python packages