Skip to content

Could not map JSON at 'supportingServicesToMonitor[0].monitoredMetrics[0].statistic' in dynatrace_aws_credentials modules #357

@EthanZmuda

Description

@EthanZmuda

Describe the bug
We are getting the error described in the title when trying to run deploys. This error is happening on settings unrelated to our changes which have previously deployed successfully. Here is the full error:

│ Error: Could not map JSON at 'supportingServicesToMonitor[0].monitoredMetrics[0].statistic' near line 1 column 287
│ 
│   with module.production_settings[0].module.aws_credentials.dynatrace_aws_credentials.cobra-prod,
│   on production/settings/aws_credentials/cobra-prod.tf line 1, in resource "dynatrace_aws_credentials" "cobra-prod":
│    1: resource "dynatrace_aws_credentials" "cobra-prod" {

This error is inconsistently happening on many dynatrace_aws_credentials modules. Sometimes when redeploying the error resolves on some modules and starts occurring on others. Here is an example of one such module:

resource "dynatrace_aws_credentials" "cobra-prod" {
  label          = "cobra-prod - TF managed"
  partition_type = "AWS_CN"
  tagged_only    = false
  authentication_data {
    account_id = "***" # I'm not sure if the account ID is sensitive so I'm censoring it
    iam_role   = "SFGBaselineDynatraceMonitoring"
  }
  supporting_services_to_monitor {
    name = "fsx"
  }
}

This error is especially odd because this module doesn't have a .monitoredMetrics[0].statistic attribute (nor do any of our modules throwing this error), yet the error is saying the issue is with that attribute. According to the documentation, this attribute is not required. Adding this attribute does not necessarily resolve the error.

Expected behavior
Successful deploys, with no inconsistent error due to an attribute in our modules which doesn't exist.

Desktop (please complete the following information):

  • GHA Runner OS: Ubuntu
  • hashicorp/aws: v4.17.1
  • dynatrace-oss/dynatrace: v1.46.1

Additional context
This issue began occurring during deploys today. Our most recent successful deploy used version v1.46.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions