# Does Monaco support loops for account level management?

**URL:** <https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232>\
**Category:** Dynatrace API\
**Tags:** account-management, monaco\
**Created:** [April 15, 2025, 8:56am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232 "2025-04-15T08:56:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumaravel](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kumaravel/32/41704_2.png) [@kumaravel](https://community.dynatrace.com/u/kumaravel)\
**Post date:** [April 15, 2025, 8:56am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/1 "2025-04-15T08:56:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [April 15, 2025, 8:58am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/2 "2025-04-15T08:58:53Z")

</div>

Hi,

You can find [here](https://docs.dynatrace.com/docs/shortlink/configuration-as-code-commands#account) Monaco account commands.

Best regards

---

<div class="post-metadata">

**Author:** ![kumaravel](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kumaravel/32/41704_2.png) [@kumaravel](https://community.dynatrace.com/u/kumaravel)\
**Post date:** [April 15, 2025, 9:10am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/3 "2025-04-15T09:10:59Z")

</div>

Hello&nbsp;[@AntonPineiro](https://community.dynatrace.com/user/58682)&nbsp;,  
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.

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [April 23, 2025, 9:16am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/4 "2025-04-23T09:16:22Z")

</div>

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&nbsp;[Advanced use cases with Go templating — Dynatrace Docs](https://docs.dynatrace.com/docs/deliver/configuration-as-code/monaco/guides/configuration-as-code-advanced-use-case)

---

<div class="post-metadata">

**Author:** ![kumaravel](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kumaravel/32/41704_2.png) [@kumaravel](https://community.dynatrace.com/u/kumaravel)\
**Post date:** [April 24, 2025, 11:21am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/5 "2025-04-24T11:21:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [April 24, 2025, 1:28pm UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/6 "2025-04-24T13:28:13Z")

</div>

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.

```markup
#!/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

```

---

<div class="post-metadata">

**Author:** ![kumaravel](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kumaravel/32/41704_2.png) [@kumaravel](https://community.dynatrace.com/u/kumaravel)\
**Post date:** [April 28, 2025, 2:36pm UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/7 "2025-04-28T14:36:48Z")

</div>

Thanks&nbsp;[@mark\_bley](https://community.dynatrace.com/user/13072)&nbsp;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?

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [April 29, 2025, 10:16am UTC](https://community.dynatrace.com/t/does-monaco-support-loops-for-account-level-management/51232/8 "2025-04-29T10:16:14Z")

</div>

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