Rather than using parameters in edr calls or simil...
# ask-elementary-ai
n
Rather than using parameters in edr calls or similar, how would my config.yml look and what tweaks would i need to make to my commands to use variables from in the config.yml @kapa.ai?
k
A message from kapa.ai
Based on the knowledge sources, I can provide information about using config.yml with Elementary Data's edr commands. ## Using config.yml with Elementary Data The config.yml file is primarily used for configuring alerts and certain platform-specific settings. It should be placed in the
.edr
directory, typically at
~/.edr/config.yml
(home directory) or you can specify a custom location using the
--config-dir
flag. ### Basic Structure For Slack configurations, your config.yml would look like:
Copy code
yaml slack:   token: <your_slack_token>   channel_name: <slack_channel_to_post_at>   group_alerts_by: "table"  # or "alert"  anonymous_usage_tracking: False
For Google Cloud Storage:
Copy code
yaml google:   service_account_path: <path_to_service_account>   gcs_bucket_name: <bucket_name>  update_bucket_website: true
### Command Usage To use the config file, you would run:
Copy code
edr monitor --config-dir ./.edr
or
Copy code
edr send-report --config-dir ./.edr
### Limitations There are several important limitations to be aware of: 1. Environment Variables: The config.yml file doesn't support environment variables or Jinja templating directly [as mentioned in multiple discussions](https://slack.com/archives/C02CTC89LAX/p1685126855599089). You cannot use syntax like
${WEBHOOK_URL}
or
{{ env_var('SLACK_TOKEN') }}
in the config file. 2. Limited Parameters: Not all edr command parameters can be configured through config.yml. As noted by an Elementary staff member, "We have some tech debt around
config.yml
to be honest. At some point we decided to deprecate it, so didn't add new configs support to it" [from this discussion](https://slack.com/archives/C02CTC89LAX/p1695959017539929). 3. Command-specific Parameters: Parameters like
--file-path
,
--target-path
,
--open-browser
,
--project-name
, and
--env
cannot be set in the config.yml file [as confirmed here](https://slack.com/archives/C02CTC89LAX/p1736350825518229). ### Workarounds For parameters that can't be set in config.yml, you have two alternatives: 1. Use CLI Parameters: Pass parameters directly in the command line. 2. Use Environment Variables: Set environment variables like
EDR_MONITOR_SLACK_TOKEN
or
EDR_SEND_REPORT_SLACK_TOKEN
[as mentioned here](https://slack.com/archives/C02CTC89LAX/p1700737966995449). For example, instead of setting the token in config.yml, you can set the environment variable and leave the token field empty in the config file. If you need to use environment variables with your config file, you might need to use a script to generate the config file dynamically before running edr commands.
n
What are all the config.yml keys possible? @kapa.ai
k
A message from kapa.ai
Based on the knowledge sources, I can provide information about the possible keys in the config.yml file for Elementary Data. However, it's important to note that the documentation doesn't provide a comprehensive list of all possible keys. From the available information, here are the config.yml keys that are supported: ### Alert Destinations
Copy code
yaml # Slack configuration slack:   notification_webhook: <your_slack_webhook_url>   # or alternatively:   token: <your_slack_token>   channel_name: <slack_channel_name>   # optional   workflows: false   group_alerts_by: "table"  # or "alert"  # Teams configuration teams:   notification_webhook: <your_teams_webhook_url>  # Google Cloud Storage configuration google:   service_account_path: <path_to_service_account>   gcs_bucket_name: <bucket_name>   bucket_file_path: <path_in_bucket>  update_bucket_website: true
### Other Settings
Copy code
yaml # Disable anonymous tracking anonymous_usage_tracking: False
It's worth noting that there are significant limitations to what can be configured through the config.yml file. As mentioned in the knowledge sources, not all CLI parameters can be set via the config file. Parameters like project directory, profiles directory, file paths, environment settings, and many others must be passed as CLI arguments or environment variables. According to Elementary staff, "most of the configurations in the config.yml are also available through the cli params so you can run 'edr monitor report --help' to see which params are available" [from this discussion](https://slack.com/archives/C02CTC89LAX/p1674837405340689). Additionally, there appears to be some technical debt around the config.yml functionality, with some Elementary staff noting that they had considered deprecating it at one point but didn't follow through [as mentioned here](https://slack.com/archives/C02CTC89LAX/p1695959017539929). For the most up-to-date and comprehensive list of available options, I would recommend running the help command for the specific edr command you're using, such as
edr monitor --help
or
edr report --help
. I hope this helps with your configuration needs! User: What are the environment variables that can be used with edr?