# Synthetic Monitor Terraform Module

**URL:** <https://community.dynatrace.com/t/synthetic-monitor-terraform-module/46506>\
**Category:** Synthetic Monitoring\
**Tags:** terraform, browser-monitors\
**Created:** [July 8, 2024, 3:40pm UTC](https://community.dynatrace.com/t/synthetic-monitor-terraform-module/46506 "2024-07-08T15:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![J-Pollard99](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@J-Pollard99](https://community.dynatrace.com/u/J-Pollard99)\
**Post date:** [July 8, 2024, 3:40pm UTC](https://community.dynatrace.com/t/synthetic-monitor-terraform-module/46506/1 "2024-07-08T15:40:52Z")

</div>

I’m currently setting up a terraform module for synthetics. Due to how we are currently using Dynatrace I want to keep the module as simple as possible for people to use. What I would like to do is pass in a file for the script block that will contain the script. I’ve tried a few different methods but am only getting errors back from the IDE. Is this something that is possible / if it is how should I approach implementing it. Below is one of the ways I’ve attempted to implement this without success.

```markup
script {
    type = var.script_type
    script = file(var.script_file)
  }

```

---

<div class="post-metadata">

**Author:** ![Eric\_Yu](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/eric_yu/32/20360_2.png) [@Eric\_Yu](https://community.dynatrace.com/u/Eric_Yu)\
**Post date:** [July 8, 2024, 4:32pm UTC](https://community.dynatrace.com/t/synthetic-monitor-terraform-module/46506/2 "2024-07-08T16:32:59Z")

</div>

It should be possible, make sure that the structure of your script is matching the reference from the docs:  
[dynatrace\_browser\_monitor | Resources | dynatrace-oss/dynatrace | Terraform | Terraform Registry](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/browser_monitor)

 ![Eric_Yu_0-1720456252571.png](https://global.discourse-cdn.com/dynatrace/original/1X/c1af6c72d68b8276d55f688454a229e9256cd2d8.png)

Seems more like a terraform question than a provider one. Want kind of errors are you getting when trying to deploy?

Is it a simple browser monitor or are your trying to setup a clickpath?

---

<div class="post-metadata">

**Author:** ![Kodai\_Ishikawa](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@Kodai\_Ishikawa](https://community.dynatrace.com/u/Kodai_Ishikawa)\
**Post date:** [July 8, 2024, 4:51pm UTC](https://community.dynatrace.com/t/synthetic-monitor-terraform-module/46506/3 "2024-07-08T16:51:58Z")

</div>

Hi&nbsp;[@J-Pollard99](https://community.dynatrace.com/user/77879)&nbsp;,

In what format were you looking to introduce the script (in other words, what does the script file look like)? Mainly wondering since there’s no `script` attribute inside of the `script` block.&nbsp;[Terraform Registry](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/browser_monitor#nestedblock--script)  
Were you referring to the script that can be generated in the UI -&nbsp;[Configure browser monitors in Classic — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/browser-monitors-config#monitor-scripts)&nbsp;?
