03 Jan 2025
09:31 AM
- last edited on
17 Feb 2025
08:48 AM
by
MaciejNeumann
I am trying to configure the Cisco network device configuration through the Terraform script. I downloaded the Extension from Hub, and init, plan commands are successfully executed and after executing apply command, I am getting an error of No write access for scope class tenant. In API token I given the all the scopes, till it is giving the same error.
Please fine the Terraform code below:
Note: I am having full platform access.
#terraform
Solved! Go to Solution.
07 Jan 2025 10:50 AM - edited 07 Jan 2025 10:51 AM
Hello @Manoharsomi
The syntax for how to configure these settings via Terraform is not exactly the same as the JSON code presented in the WebUI suggests. What makes matters worse here is that the error message thrown back from the REST API leads you down the (wrong) rabbit hole of permissions.
You should be able to apply the monitoring configuration using this code:
resource "dynatrace_hub_extension_config" "test" {
name = "com.dynatrace.extension.snmp-generic-cisco-device"
active_gate_group = "default"
value = jsonencode(
{
"description" : "Cisco device configuration",
"version" : "2.1.4",
"enabled" : true,
"description" : "test",
"snmp" : {
"devices" : [
{
"ip" : "0.0.0.0",
"port" : 161,
"authentication" : {
"type" : "SNMPv3",
"userName" : "user",
"securityLevel" : "AUTH_PRIV",
"authPassword" : "password",
"authProtocol" : "SHA",
"privPassword" : "password",
"privProtocol" : "AES256C"
}
}
]
},
"featureSets" : [
"BGP",
"Health",
"High availability",
"Interfaces",
"Interfaces 32-bit",
"Interfaces 64-bit",
"Memory pools",
"Power supply",
"Sensors",
"Traffic"
]
}
)
}
07 Jan 2025 11:56 AM
Thank you so much @reinhard_pilz . provided solution is working perfectly👏👏
12 Feb 2025 05:48 AM
Hi @reinhard_pilz ,
Could you please provide the Terraform script to modify the host group name through API?
12 Feb 2025 07:46 AM
Hi,
No idea about Terraform, I only use Monaco but, I think you can download an existing configuration to check how config files should be created.
Best regards
14 Feb 2025 09:45 AM
Hi @reinhard_pilz
Any update on Terraform script to modify the host group name through API?
your assistance is highly appreciated.
Thank you,
Manohar