DataDog / datadog-cloudformation-macro

CloudFormation Macros by Datadog
Apache License 2.0
14 stars 22 forks source link

CloudFormation Macro support for two Cloudwatch log group subscription filters #26

Closed zARODz11z closed 3 years ago

zARODz11z commented 3 years ago

CloudFormation Macro support for two Cloudwatch log group subscription filters

What does this PR do?

This PR edits the logic in the forwarder.ts file to support two Cloudwatch log group subscription filters. Additionally this PR tests the new logic with unit tests in the forwarder.spec.ts file. This PR allows the Datadog Cloudformation macro to take full advantage of AWS cloudwatch log group's support for 2 log group subscription filters.

Motivation

AWS Cloudwatch log groups added support for up to 2 subscription filters per log group and the Datadog Cloudformation macro logic currently only supports 1 subscription filter per log group.

Testing Guidelines

I added unit tests for the new cases introduced by Cloudformations support of up to 2 log group subscription filters per log group and additionally manually tested these cases by repeatedly deploying a test SAM Lambda function with the test scenarios and confirming the expected result in the AWS console.

Additional Notes

Types of changes

Check all that apply

codecov-io commented 3 years ago

Codecov Report

Merging #26 (0ca848d) into master (54b3e98) will increase coverage by 0.23%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   89.16%   89.40%   +0.23%     
==========================================
  Files           7        7              
  Lines         360      368       +8     
  Branches       85       87       +2     
==========================================
+ Hits          321      329       +8     
  Misses         20       20              
  Partials       19       19              
Impacted Files Coverage Δ
serverless/src/forwarder.ts 88.34% <100.00%> (+0.98%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 54b3e98...0ca848d. Read the comment docs.