updating documentation

master
SLW\ARNAUA 2023-06-06 14:51:37 +02:00
parent 3c087ae694
commit 83e8bec4fd
1 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,7 @@
# CoCo APM Dynatrace Terraform BackUp Exporter
The main purpose of the coco_apm_dynatrace_terraform_backup_exporter is to pull all the available configuration files from Dynatrace to back them up.
## Environment Variables
To run this project, you will need to add an .env file with the following environment variables:
@ -20,11 +21,15 @@ In order to run the program on the local machine, it is necessary to install the
pip3 install --user -r requirements.txt
```
### Terraform Provider for Dynatrace
It is also required to install the Terraform Provider for [Dynatrace](https://github.com/dynatrace-oss/terraform-provider-dynatrace/releases). Once you download and extract as selected version of the provider, please make sure to add the `directory` of the extracted `executable` as well as the filename of it in `tf-provider-config.yaml`.
It is also required to install the Terraform Provider for [Dynatrace](https://github.com/dynatrace-oss/terraform-provider-dynatrace/releases). Once you download and extract a selected version of the provider, please make sure to add the `directory` of the extracted `executable` as well as the filename of it in `tf-provider-config.yaml`.
### Additional configurations
Note: Additionally you must configure the environment url `env-url` and output directory `output-dir` within the `env-config.yaml` file in the future if your environment url changes or if you prefer a different output directory.
## Run Locally
In order to make a backup of all the available enviornments that are configured within the `configuration.yaml` file you can execute the script with the following command:
@ -36,6 +41,7 @@ python3 .\export
## Documentation
The Documentation briefly describes the currently set up backup process and a scenario for restoration.
### BackUp Process
The export script is executed every day at 5 AM by [Jenkins](https://jaws.bmwgroup.net/opapm/job/coco_apm_dynatrace_terraform_backup_exporter/). Jenkins pushes the backup to the [coco_apm_dynatrace_terraform_backup](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/coco_apm_dynatrace_terraform_backup/browse) by creating a branch with a timestamp. Each branch contains the dashboards and all other configurations stored both separately. The reason for this is due to the Terraform Dynatrace Provider - in the [GitHub documentation](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/coco_apm_dynatrace_terraform_backup/browse) it is stated that dashboards need to be exported separately.
@ -63,9 +69,11 @@ Explanation:
- (A) The error indicates that Terraform v0.12 does not support the downloaded Terraform Dynatrace Provider version 1.30.2. Therefore it was necessary to downgrade to 1.30.1!
- (B) It could also mean a misconfiguration of the environment within `env-conig.yaml`. Example: Wrong token or environment url, therefore the environment cannot be found and the warning alongside the error are thrown. As a result no configuration files as well as dashboards could be downloaded, resulting in an empty backup directory.
### Restore Process
If you are planning to restore the backed up configuration files or dashboards, then you will need to install [Terraform](https://developer.hashicorp.com/terraform/downloads) on your local machine. Do not forget to add the binary file to your system environment path.
### Usage/Examples for Restoration
Scenario: A dashboard has tile has been changed or accidently deleted. How can this be solved?