terraform-provider-dynatrace icon indicating copy to clipboard operation
terraform-provider-dynatrace copied to clipboard

Issue with dynatrace_credentials Resource and PEM File Upload

Open TheLooostOne opened this issue 4 weeks ago • 0 comments

Hello,

I’m working on creating a new dynatrace_credentials resource to upload a PEM certificate for validating extensions. The resource definition I’m using is as follows:

resource "dynatrace_credentials" "root_certificate" {
  name        = "Root Certificate"
  description = "Root certificate for validating Extension 2.0 signatures"
  certificate = file("modules/plugins/temp/root.pem")
  format      = "PEM"
  public      = true
}

When uploading the same PEM file through the Dynatrace UI, the file is accepted, and the credential is created successfully. However, when applying these changes via Terraform, I encounter the following error: Could not add credential: Failed to decode certificate payload Illegal base64 character 2d. Since the file works without issue in the UI, I’m wondering if there’s a specific configuration I’m missing in Terraform, or if there’s something unique about how the certificate field is being processed. Any guidance on resolving this would be greatly appreciated.

Version used : 1.72.6

Thank you!

TheLooostOne avatar Jan 27 '25 15:01 TheLooostOne