53 lines
1.9 KiB
Markdown
53 lines
1.9 KiB
Markdown
# TerraformOnboarding
|
|
The purpose of the exportConfig.py script is to onboard dynatrace services by the help of a custom template.
|
|
|
|
|
|
# Setup
|
|
Run the following command to install all necessary dependencies:
|
|
|
|
```python
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
In order to ensure full functionality a `.env` file is necessary with the following format:
|
|
|
|
```
|
|
CN_PREPROD_ENV_URL="https://dynatracemgd-cn.bmwgroup.net/e/ab88c03b-b7fc-45f0-9115-9e9ecc0ced35"
|
|
CN_PROD_ENV_URL="https://dynatracemgd-cn.bmwgroup.net/e/b921f1b9-c00e-4031-b9d1-f5a0d530757b"
|
|
EMEA_PREPROD_ENV_URL="https://qqk70169.live.dynatrace.com"
|
|
EMEA_PROD_ENV_URL="https://xxu26128.live.dynatrace.com"
|
|
NA_PREPROD_ENV_URL="https://onb44935.live.dynatrace.com"
|
|
NA_PROD_ENV_URL="https://wgv50241.live.dynatrace.com"
|
|
```
|
|
Place the `.env` file within the root directory of the project folder:
|
|
|
|
```bash
|
|
TerraformOnboarding # Project Folder
|
|
├─── _dynatrace-base-modules # Required modules for templates
|
|
├─── templates # Templates
|
|
├─── .env # Add the environment file here
|
|
├─── .gitignore
|
|
├─── README.md
|
|
└─── requirements.txt
|
|
```
|
|
|
|
# Run
|
|
You can simply run the script by executing the following example command within the projects root directory:
|
|
|
|
```python
|
|
python onboarding.py <dirname> <tag1,tag2,...>
|
|
```
|
|
**Note:** Please note that it is required to delimit the tags by a comma!
|
|
|
|
Here is an example command:
|
|
|
|
```python
|
|
python onboarding.py CD_ASBC-PKI-DFP DFP,DFPH
|
|
```
|
|
In the above example command the directory is going to be created with the name **CD_ASBC-PKI-DFP** within a generated **./output** folder. The key values of the template files will be replaced wit the associated tags delimited by a comma in the shell. The generated files will be stored in subfolders of the **CD_ASBC-PKI-DFP** folder respectively.
|
|
|
|
|
|
# Version
|
|
```python
|
|
Python 3.9.9
|
|
``` |