CloudWatch metrics/alarms now support non-CloudWatch sources via an adapter Lambda function. The request/response structures are complex enough that they would benefit from having a strongly typed wrapper.
Solution/User Experience
The aws_lambda_powertools.utilities.data_classes namespace includes type for the new GetMetricData event and the corresponding MetricDataResults response.
NOTE: Although the event shares a name with an existing API call, it does not have the same structure and the existing definitions cannot be used here.
Use case
CloudWatch metrics/alarms now support non-CloudWatch sources via an adapter Lambda function. The request/response structures are complex enough that they would benefit from having a strongly typed wrapper.
Solution/User Experience
The
aws_lambda_powertools.utilities.data_classes
namespace includes type for the newGetMetricData
event and the correspondingMetricDataResults
response.NOTE: Although the event shares a name with an existing API call, it does not have the same structure and the existing definitions cannot be used here.
Alternative solutions
Acknowledgment