08 Jul 2024 04:40 PM
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)
}
Solved! Go to Solution.
08 Jul 2024 05:32 PM
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
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?
08 Jul 2024 05:51 PM
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 ?