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

Synthetic Monitor Terraform Module

J-Pollard99
Newcomer

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. 


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

 

 

2 REPLIES 2

Eric_Yu
Dynatrace Mentor
Dynatrace Mentor

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

Eric_Yu_0-1720456252571.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?

Eric Yu | LATAM ACE Consultant

Kodai_Ishikawa
Dynatrace Helper
Dynatrace Helper

Hi @J-Pollard99 ,

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. https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/browser_monito...
Were you referring to the script that can be generated in the UI - https://docs.dynatrace.com/docs/shortlink/browser-monitors-config#monitor-scripts ?

Featured Posts