Closed JayChanggithub closed 3 days ago
Hi @JayChanggithub,
Just to clarify, previously you were able to configure both classic and cloud services at the same time via Terraform (API) despite that shouldn't have been possible based off of the documentation? And the behavior now is that you are unable to do so due to the errors?
If that's the case, I don't believe it was intentional that they allowed this functionality via the API (as a result, also in Terraform). The error messages aren't being produced by the Terraform code, but is being returned by our API.
I would recommend to migrate to cloud services as that would allow additional configuration of monitored services.
Hi @kishikawa12
Thank you for the clarification. I would like to request some best practice examples of Terraform code for these resources. If we decide to migrate to cloud services, should we reuse the previous approach? If so, do you have any recommendations?
The following code is our latest changed.
resource "dynatrace_azure_credentials" "azure_credential" {
active = true
monitor_only_tagged_entities = true
app_id = var.app_id
auto_tagging = true
directory_id = var.directory_id
key = var.svc_secret
label = var.k8s_cluster
monitor_only_tag_pairs {
name = var.k8s_cluster
value = "true"
}
}
data "dynatrace_azure_supported_services" "supported_services" {
except = [
"AZURE_STORAGE_ACCOUNT",
"AZURE_SQL",
"AZURE_LOAD_BALANCER",
"AZURE_IOT_HUB",
"AZURE_COSMOS_DB",
"AZURE_REDIS_CACHE",
"AZURE_APPLICATION_GATEWAY",
"AZURE_API_MANAGEMENT_SERVICE"
]
}
resource "dynatrace_azure_service" "azure_services" {
for_each = data.dynatrace_azure_supported_services.supported_services.services
credentials_id = dynatrace_azure_credentials.azure_credential.id
use_recommended_metrics = true
name = each.key
}
Hi @JayChanggithub,
I double checked with R&D on Azure supported services since I believe the documentation may not have been entirely clear.
The most important thing to note is that for full coverage, you would need to utilize a combination of built-in AND cloud services since there are services that don't exist in the new cloud services.
If you take a look at the right side of this table, these are the eight supported services that have a corresponding new cloud service. In other words, disabling these eight services in your Terraform configuration will migrate you to the new cloud services AND leave the built-in services required to give you full coverage of all supported services.
The most recent Terraform code you provided looks good, I've also tested this in my environment and confirmed that it works as expected.
@kishikawa12
Thank you for the clarification. I have been using the code I provided across several deployment environments, and the screenshot shows one of those environments.
@JayChanggithub Looks good to me, was there something that didn't look correct?
Thanks!
@JayChanggithub I'll close this ticket for now, please feel free to reopen if you run into anymore issues. Thanks!
Describe the bug
As mentioned in the documentation, Azure Classic (built-in) cannot be enabled simultaneously with the cloud service. Earlier, we adopted the Terraform Dynatrace provider for this purpose. However, we're currently encountering the mentioned error. I'd appreciate some assistance to clarify the issue. And if we'd like to choose only cloud service instead of classic(built in) while conflict. How to update below code block? Thanks.
dynatrace provider revision: 1.42.0
code block
error log