[PR #2286/118905b8 backport][stable-8] cloudwatchlogs_log_group_metric_filter: add support for unit and dimensions #2361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #2286 as merged into main (118905b).
SUMMARY
This PR adds support for the options
unit
anddimensions
in thecloudwatchlogs_log_group_metric_filter
module.This enables configuring
unit
anddimensions
in Cloudwatch Logs Metricfilters using ansible, which was previously not possible.The addition is pretty straigthforward since both
unit
anddimensions
are part of themetric_transformation
parameter.dimensions
anddefault_value
are mutually exclusive, however:mutually_exclusive
was not possible. Instead a custom check was added to the module that throws an error when both parameters are present.An integration test has been added for this case, as well as for configuring metric_filters with units and/or dimensions.
The function metricTransformationHandler has been rewritten slightly due to the addition of the two extra optional parameters, to make it a bit more readable.
Happy to get your feedback!
ISSUE TYPE
COMPONENT NAME
cloudwatchlogs_log_group_metric_filter
ADDITIONAL INFORMATION