Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use environment-name as parameter in the yaml or json #731

Open
heydenb opened this issue Sep 6, 2022 · 5 comments
Open

Use environment-name as parameter in the yaml or json #731

heydenb opened this issue Sep 6, 2022 · 5 comments
Labels
enhancement New feature or request internally-tracked We've moved this issue to the internal backlog of the core team.

Comments

@heydenb
Copy link

heydenb commented Sep 6, 2022

Is it possible to use the environment name as variable.
It is passed to monaco via "-s" and described in the environments.yaml
If so, what is the correct notation. I don't find it in the docs.
If not, this would be an interesting feature for us since our monaco envs match the name of the management zones and the environment tag.

@heydenb heydenb added the enhancement New feature or request label Sep 6, 2022
@UnseenWizzard
Copy link
Collaborator

Hi @heydenb.
Currently it is not possible to reference an environment name as a variable.
But we will keep this as an enhancement request (thanks for already labeling it 👍)

How would you expect this to behave if no specific-environment is selected?
I would imagine something like a .global.currentEnvironment variable that would contain the name of the environment that the config is being deployed to. Is that what you'd expect too?

@heydenb
Copy link
Author

heydenb commented Sep 13, 2022

Yes, something like that. If no specific env is selected I presume that monaco sequentially walks over all configured envs to push the update. At that moment it knows which env it is processing, right ;-)

@andycarlsonbt
Copy link

+1
Monaco promises to allow us to apply config changes to multiple tenants but sometimes the content of those changes can vary between tenants - for example the DNS name of a service may differ between test and production or the recipients of an alert may vary.

I can see several possible ways to allow this with different pros and cons...

  1. Pass just the env name... then I think the template would need to contain 'if' logic based on the env
  2. Allow config values to be specified in the manifest yaml in a similar manner to the config yaml
  3. Allow the config values in the config yaml to be specified as a map using the env name as the key

@UnseenWizzard
Copy link
Collaborator

Hi @andycarlsonbt,

I might be misunderstanding your issue, but I think you're asking for something else than described here.

Overwriting variables (or the JSON template that is being used) per environment is a standard feature of monaco.

Here are the docs for 2.x: https://www.dynatrace.com/support/help/manage/configuration-as-code/configuration/yaml-configuration#overriding-configuration-per-environment
and here for 1.x: https://dynatrace.github.io/dynatrace-configuration-as-code/configuration/yaml_config#specific-configuration-per-environment-or-group

What was asked for here is to use the environment name within configuration, which is not currently possible

@andycarlsonbt
Copy link

Thanks, I hadn't spotted the section on environment overrides. I'll give that a try.

@UnseenWizzard UnseenWizzard added the internally-tracked We've moved this issue to the internal backlog of the core team. label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internally-tracked We've moved this issue to the internal backlog of the core team.
Projects
None yet
Development

No branches or pull requests

3 participants