Skip to content

AWS Shield DDoSDetected metric splitting to snakecase on change from upper to lowercase letter #769

@AronNaylor

Description

@AronNaylor

When splitting the AWS Shield Advanced DDoSDetected CloudWatch metric, it is incorrectly being parsed as follows due to the linked method:

region: us-east-1
metrics:
- aws_dimensions:
  aws_metric_name: DDoSDetected
  aws_namespace: AWS/DDoSProtection
  aws_statistics:
  - Sum

Becomes:

aws_ddosprotection_ddo_sdetected_sum

This occurs only when a lowercase letter appears in the middle of a word within a metric name which contains multiple words (see example above), but not the namespace (see code refs below).

return str.replaceAll("([a-z0-9])([A-Z])", "$1_$2").toLowerCase();

safeName(rule.awsNamespace.toLowerCase() + "_" + toSnakeCase(rule.awsMetricName));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions