Go to file
Patryk Gudalewicz d65a715f32 "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 19:13:06 +01:00
CN_PREPROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 18:47:43 +01:00
CN_PROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 18:53:17 +01:00
EMEA_PREPROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 18:57:51 +01:00
EMEA_PROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 19:06:44 +01:00
NA_PREPROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 19:10:01 +01:00
NA_PROD "Migrating from Monaco to Terraform for management zone: CD_tol-tssb" 2023-03-01 19:13:06 +01:00
_templates Changing data structure 2023-01-11 12:49:52 +01:00
.gitignore Empty structure 2022-12-31 13:52:11 +01:00
environment.yaml Adjusting script and file names 2023-01-01 16:27:39 +01:00
onboarding.py Changing data structure 2023-01-11 12:49:52 +01:00
readme.md Updating readme 2023-01-26 09:26:31 +01:00
requirements.txt Adding script to template 2023-01-01 16:03:19 +01:00

readme.md

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_<appname>
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_<app_name> -C <compass_id>
    4.2 Additional features (see Usage section):
        python ./onboarding.py -A CD_<app_name> -C <compass_id> -F <features>
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 <changes>

    git commit -m "<OPMAAS-XXX> - Add initial configuration of application <app_name> to Dynatrace"

    git push -u origin CD_<app_name>
8. Create pull request from CD_<app_name> 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