Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::Logs::MetricFilter MetricValues permits invalid strings #1525

Closed
trav-c opened this issue May 11, 2020 · 2 comments · Fixed by #1647
Closed

AWS::Logs::MetricFilter MetricValues permits invalid strings #1525

trav-c opened this issue May 11, 2020 · 2 comments · Fixed by #1647
Labels
good first issue Good for newcomers

Comments

@trav-c
Copy link
Contributor

trav-c commented May 11, 2020

cfn-lint 0.30.1

AWS::Logs::MetricFilter.Properties.MetricTransformations[*].MetricValue allows a bare string not starting with '$' which it appears is never actually valid, ie
"MetricValue: length" vs "MetricValue: $length"

Assuming I'm reading the documentation correctly MetricValue must always either be a number OR start with a '$' character.

The following fragment lints, but is rejected by CloudFormation at runtime without a $ at the start of the named MetricValue field

    QueueLengthMetricFilter:
        Type: AWS::Logs::MetricFilter
        Properties:
            LogGroupName: !Ref LogGroup
            FilterPattern: '[date, time, tag="rh-sched*", x01=throttling, x02="jobs.", ..., x10=Len, x11=of, x12=job, x13="queue*",  length]'
            MetricTransformations:
              - MetricValue: length
                MetricNamespace: !Sub '${EnvironmentName}'
                MetricName: 'JobsQueued'

Note: I believe that this is also missed by the AWS ValidateTemplate API

@PatMyron PatMyron added the good first issue Good for newcomers label May 11, 2020
@ghost
Copy link

ghost commented Aug 12, 2020

This is still an issue, would love to see it fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants