cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does Monaco support loops for account level management?

kumaravel
Contributor

Hello,

I am trying to manage the users, groups and policies via Monaco. The numbers of groups to be managed via SAML is large with some minor differnces.

So is there a way to use the go templating or some other way to configure the groups in Monaco with some loop iteration?

 

Dynatrace Certified Associate
7 REPLIES 7

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

You can find here Monaco account commands.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

kumaravel
Contributor

Hello @AntonPineiro ,
I have seen the mentioned documentation, but I wanted to check for templating options.
Example, - Configure 10 SAML groups with the same default policy.
In this case, I have to add 10 items under the groups. I was looking for an option similar to environment settings where the json file can have templating to perform loops and the yaml can be configured with parameters.

 

Dynatrace Certified Associate

mark_bley
Dynatrace Champion
Dynatrace Champion

Not entirely sure of the use case you are describing it sounds like you could reuse the 1 template for all the groups.

But still you can use loops in monaco templating, here is a sample to such configuration https://docs.dynatrace.com/docs/deliver/configuration-as-code/monaco/guides/configuration-as-code-ad...

 

kumaravel
Contributor

I have tried the Monaco templating but that works for the json template file for other configuration. But the account configuration are done directly in the yaml config file. Is there some example which could be used as a reference?

Dynatrace Certified Associate

mark_bley
Dynatrace Champion
Dynatrace Champion

My bad forgot about the templating in regards to the account configuration, here you have a sample script I have used before to create such entries.

#!/bin/bash

entries=(
  "the_innovators"
  "creative_collective"
  "the_dream_team"
  "visionary_voices"
  "the_trailblazers"
  "unity_squad"
  "the_think_tank"
  "synergy_circle"
  "the_pioneers"
  "dynamic_alliance"
)

for entry in "${entries[@]}"; do
    cat <<EOL
- name: $entry
  id: $entry
  description: This is my group
  account:
    permissions:
    - account-viewer
    policies:
    - Environment role - Access environment
EOL
done

kumaravel
Contributor

Thanks @mark_bley for sharing the sample script. 

So we need to create the yaml using the script outside Monaco and is not possible directly like in templating option right?

Dynatrace Certified Associate

mark_bley
Dynatrace Champion
Dynatrace Champion

Yes indeed, that would be an option, afaik for now there is no way to templatize in a large scale account management configurations.

Featured Posts