31 Jul 2023 01:08 PM - last edited on 31 Jul 2023 02:04 PM by Ana_Kuzmenchuk
1. Exported session replay web privacy:
> $DYNATRACE_TERRAFORM_BIN -export -ref -id dynatrace_session_replay_web_privacy
2. Added variables: in ___variables___.tf
variable "dynatrace_web_application" {
type = any
}
variable "dynatrace_web_application_playback_masking_preset" {
type = string
default = "MASK_USER_INPUT"
}
variable "dynatrace_web_application_recording_masking_preset" {
type = string
default = "MASK_USER_INPUT"
}
3. Changed one of configs:
# ID vu9U3hXa3q0AAAABAC1idWlsdGluOnNlc3Npb25yZXBsYXkud2ViLnByaXZhY3ktcHJlZmVyZW5jZXMAC0FQUExJQ0FUSU9OABAwQjJBRUU3QzlBNENBRjNDACQ2MjVjNGZiYi02NmU5LTNiZGYtYWUyYS03YWM2MzdiM2EzNTK-71TeFdrerQ
resource "dynatrace_session_replay_web_privacy" "APPLICATION-0B2AEE7C9A4CAF3C" {
application_id = "APPLICATION-0B2AEE7C9A4CAF3C"
enable_opt_in_mode = false
masking_presets {
playback_masking_preset = "${var.dynatrace_web_application_playback_masking_preset}"
recording_masking_preset = "${var.dynatrace_web_application_recording_masking_preset}"
}
}
4. terraform plan: No changes. Your infrastructure matches the configuration.
I don't found an answer from docs:
https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2#-id
On terraform sources mentioned the plan logic is up to provider.
Solved! Go to Solution.
01 Aug 2023 12:23 AM
Hey Slawa,
Unless someone has an answer here I would recommend opening a Github issue for the provider, the team that maintains it is generally very active and should be able to assist.
Issues · dynatrace-oss/terraform-provider-dynatrace (github.com)
01 Aug 2023 08:24 PM - edited 01 Aug 2023 08:24 PM
I found my mistake.
It was'n mentioned in explicily, but need to define modules(folders with files) to start traking changes after init:
e.g.
module "slo_v2n" {
source = "./configuration/modules/slo_v2n"
}