<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best Practices for Organizing Terraform Configuration for Dynatrace in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/271561#M35880</link>
    <description>&lt;P&gt;Hey &lt;SPAN class=""&gt;SjoerdB&amp;nbsp;-- Thanks for the advice. Definitely get's me a good starting point. Appreciate your help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 20:57:50 GMT</pubDate>
    <dc:creator>lwaldrop</dc:creator>
    <dc:date>2025-03-04T20:57:50Z</dc:date>
    <item>
      <title>Best Practices for Organizing Terraform Configuration for Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/268779#M35547</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I'm working on implementing a Terraform configuration for Dynatrace across multiple environments (e.g., prod, test). I have no issues exporting the existing configuration or importing state, but I’m looking for advice on how to best organize the exported data.&lt;/P&gt;
&lt;P&gt;By default, the export creates a structure with a configuration folder with modules. Is this the recommended approach, or is there a better way to structure it—especially when managing multiple environments?&lt;/P&gt;
&lt;P&gt;Since I'm new to this, I’d appreciate any guidance on how to visualize and structure the project effectively. Here’s what my directory looks like after a partial export:&lt;/P&gt;
&lt;P&gt;C:\Users\Lance\source\repos\&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;dynatrace-terraform-project\
&lt;UL&gt;
&lt;LI&gt;.terraform\...\terraform-provider-dynatrace_v1.73.0.exe&lt;/LI&gt;
&lt;LI&gt;configuration\
&lt;UL&gt;
&lt;LI&gt;.terraform
&lt;UL&gt;
&lt;LI&gt;modules\&lt;SPAN&gt;modules.json&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;providers\...\terraform-provider-dynatrace_v1.73.0.exe&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;modules/alerting/.tf files for alerting configuration including a providers and variables.tf (example)&lt;/LI&gt;
&lt;LI&gt;.terraform.lock.hcl&lt;/LI&gt;
&lt;LI&gt;providers.tf&lt;/LI&gt;
&lt;LI&gt;main.tf&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;.terraform.lock.hcl&lt;/LI&gt;
&lt;LI&gt;providers.tf&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Sincerely,&lt;BR /&gt;Lance&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 07:10:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/268779#M35547</guid>
      <dc:creator>lwaldrop</dc:creator>
      <dc:date>2025-04-02T07:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practices for Organizing Terraform Configuration for Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/269049#M35592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/60570"&gt;@lwaldrop&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I created a terraform structure, where I use separate terraform-workspaces to keep the state of the individual tenants (Dev/Test/Acc/Prod), and created settings.yaml file per environment:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;terraform&lt;UL&gt;&lt;LI&gt;environments&lt;UL&gt;&lt;LI&gt;develop&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;test&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;acceptance&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;production&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In the locals.tf, I read the correct settings file per tenant, based on the workspace name.... So if I "terraform workspace select develop", automatically my /environments/develop/settings.yaml gets activated.&lt;/P&gt;&lt;P&gt;In this way I can easily create specific variables containing configuration items/names specific to an environment (e.g. HOST-GROUP-12345678) or specific name-prefixes which are different between environments (e.g. subdirectory names in log directories).&lt;/P&gt;&lt;P&gt;Further I created multiple "top-level" main-entries, like "system" and "sre" to make a splitting between resonsibilities. Inside those directories I'm keeping the original module names as visible in the export, because that gives me a hint of the original API/rule that is used to inject the setting...&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;terraform&lt;UL&gt;&lt;LI&gt;environments (see above)&lt;UL&gt;&lt;LI&gt;develop&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;test&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;UL&gt;&lt;LI&gt;&lt;UL&gt;&lt;LI&gt;acceptance&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;production&lt;UL&gt;&lt;LI&gt;settings.yaml&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;system&lt;UL&gt;&lt;LI&gt;dashboards_general&lt;/LI&gt;&lt;LI&gt;...&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;sre&lt;UL&gt;&lt;LI&gt;custom_service&lt;/LI&gt;&lt;LI&gt;...&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;locals.tf&lt;/LI&gt;&lt;LI&gt;main.tf&lt;/LI&gt;&lt;LI&gt;version.tf&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;hope this helps somewhat...&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 11:00:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/269049#M35592</guid>
      <dc:creator>SjoerdB</dc:creator>
      <dc:date>2025-02-03T11:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practices for Organizing Terraform Configuration for Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/271561#M35880</link>
      <description>&lt;P&gt;Hey &lt;SPAN class=""&gt;SjoerdB&amp;nbsp;-- Thanks for the advice. Definitely get's me a good starting point. Appreciate your help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 20:57:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/271561#M35880</guid>
      <dc:creator>lwaldrop</dc:creator>
      <dc:date>2025-03-04T20:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practices for Organizing Terraform Configuration for Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/274139#M36201</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/16542"&gt;@SjoerdB&lt;/a&gt;&amp;nbsp; - I'd be very curious to learn more about how you've built this out with Terraform workspaces. It seems like a slick way to have support for a common configuration of resources across mutiple, separate Dynatrace tenants each with unique id's for the same configurations (e.g. scoped by host group, host id, service id, etc) Do you have a repo somewhere or more detailed examples to share?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 20:45:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Best-Practices-for-Organizing-Terraform-Configuration-for/m-p/274139#M36201</guid>
      <dc:creator>m3tomlins</dc:creator>
      <dc:date>2025-04-01T20:45:33Z</dc:date>
    </item>
  </channel>
</rss>

